Parcourir la source

@uppy/locales: refactor to ESM (#3707)

Antoine du Hamel il y a 3 ans
Parent
commit
44e368ed39
40 fichiers modifiés avec 401 ajouts et 400 suppressions
  1. 2 0
      .eslintrc.js
  2. 1 0
      packages/@uppy/locales/package.json
  3. 11 11
      packages/@uppy/locales/src/ar_SA.js
  4. 11 11
      packages/@uppy/locales/src/bg_BG.js
  5. 14 14
      packages/@uppy/locales/src/cs_CZ.js
  6. 11 11
      packages/@uppy/locales/src/da_DK.js
  7. 11 11
      packages/@uppy/locales/src/de_DE.js
  8. 11 11
      packages/@uppy/locales/src/el_GR.js
  9. 11 11
      packages/@uppy/locales/src/en_US.js
  10. 11 11
      packages/@uppy/locales/src/es_ES.js
  11. 11 11
      packages/@uppy/locales/src/fa_IR.js
  12. 11 11
      packages/@uppy/locales/src/fi_FI.js
  13. 11 11
      packages/@uppy/locales/src/fr_FR.js
  14. 11 11
      packages/@uppy/locales/src/gl_ES.js
  15. 11 11
      packages/@uppy/locales/src/he_IL.js
  16. 11 11
      packages/@uppy/locales/src/hr_HR.js
  17. 8 8
      packages/@uppy/locales/src/hu_HU.js
  18. 11 11
      packages/@uppy/locales/src/id_ID.js
  19. 11 11
      packages/@uppy/locales/src/is_IS.js
  20. 11 11
      packages/@uppy/locales/src/it_IT.js
  21. 11 11
      packages/@uppy/locales/src/ja_JP.js
  22. 8 8
      packages/@uppy/locales/src/ko_KR.js
  23. 11 11
      packages/@uppy/locales/src/nb_NO.js
  24. 11 11
      packages/@uppy/locales/src/nl_NL.js
  25. 11 11
      packages/@uppy/locales/src/pl_PL.js
  26. 11 11
      packages/@uppy/locales/src/pt_BR.js
  27. 11 11
      packages/@uppy/locales/src/pt_PT.js
  28. 11 11
      packages/@uppy/locales/src/ro_RO.js
  29. 16 16
      packages/@uppy/locales/src/ru_RU.js
  30. 11 11
      packages/@uppy/locales/src/sk_SK.js
  31. 1 1
      packages/@uppy/locales/src/sr_RS_Cyrillic.js
  32. 1 1
      packages/@uppy/locales/src/sr_RS_Latin.js
  33. 11 11
      packages/@uppy/locales/src/sv_SE.js
  34. 11 11
      packages/@uppy/locales/src/th_TH.js
  35. 11 11
      packages/@uppy/locales/src/tr_TR.js
  36. 16 16
      packages/@uppy/locales/src/uk_UA.js
  37. 11 11
      packages/@uppy/locales/src/vi_VN.js
  38. 4 6
      packages/@uppy/locales/src/zh_CN.js
  39. 11 11
      packages/@uppy/locales/src/zh_TW.js
  40. 11 11
      packages/@uppy/locales/template.js

+ 2 - 0
.eslintrc.js

@@ -207,6 +207,8 @@ module.exports = {
         'packages/@uppy/form/src/**/*.js',
         'packages/@uppy/google-drive/src/**/*.js',
         'packages/@uppy/image-editor/src/**/*.js',
+        'packages/@uppy/locales/src/**/*.js',
+        'packages/@uppy/locales/template.js',
         'packages/@uppy/svelte/src/**/*.js',
         'packages/@uppy/svelte/rollup.config.js',
         'packages/@uppy/vue/src/**/*.js',

+ 1 - 0
packages/@uppy/locales/package.json

@@ -3,6 +3,7 @@
   "description": "Uppy language packs",
   "version": "2.0.9",
   "license": "MIT",
+  "type": "module",
   "keywords": [
     "uppy",
     "uppy-plugin",

+ 11 - 11
packages/@uppy/locales/src/ar_SA.js

@@ -1,4 +1,11 @@
-const ar_SA = {}
+const ar_SA = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 ar_SA.strings = {
   addMore: 'أضف المزيد',
@@ -137,15 +144,8 @@ ar_SA.strings = {
   openFolderNamed: '%{name} افتح المجلد',
 }
 
-ar_SA.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.ar_SA = ar_SA
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.ar_SA = ar_SA
 }
 
-module.exports = ar_SA
+export default ar_SA

+ 11 - 11
packages/@uppy/locales/src/bg_BG.js

@@ -1,4 +1,11 @@
-const bg_BG = {}
+const bg_BG = {
+  pluralize (count) {
+    if (count === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 bg_BG.strings = {
   addBulkFilesFailed: {
@@ -143,15 +150,8 @@ bg_BG.strings = {
   },
 }
 
-bg_BG.pluralize = function pluralize (count) {
-  if (count === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.bg_BG = bg_BG
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.bg_BG = bg_BG
 }
 
-module.exports = bg_BG
+export default bg_BG

+ 14 - 14
packages/@uppy/locales/src/cs_CZ.js

@@ -1,4 +1,14 @@
-const cs_CZ = {}
+const cs_CZ = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    if (n > 1 && n < 5) {
+      return 1
+    }
+    return 2
+  },
+}
 
 cs_CZ.strings = {
   addMore: 'Přidat další',
@@ -138,18 +148,8 @@ cs_CZ.strings = {
   },
 }
 
-cs_CZ.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  if (n > 1 && n < 5) {
-    return 1
-  }
-  return 2
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.cs_CZ = cs_CZ
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.cs_CZ = cs_CZ
 }
 
-module.exports = cs_CZ
+export default cs_CZ

+ 11 - 11
packages/@uppy/locales/src/da_DK.js

@@ -1,4 +1,11 @@
-const da_DK = {}
+const da_DK = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 da_DK.strings = {
   addMore: 'Tilføj flere',
@@ -137,15 +144,8 @@ da_DK.strings = {
   },
 }
 
-da_DK.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.da_DK = da_DK
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.da_DK = da_DK
 }
 
-module.exports = da_DK
+export default da_DK

+ 11 - 11
packages/@uppy/locales/src/de_DE.js

@@ -1,4 +1,11 @@
-const de_DE = {}
+const de_DE = {
+  pluralize (count) {
+    if (count === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 de_DE.strings = {
   addBulkFilesFailed: {
@@ -178,15 +185,8 @@ de_DE.strings = {
   zoomOut: 'Verkleinern',
 }
 
-de_DE.pluralize = function pluralize (count) {
-  if (count === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.de_DE = de_DE
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.de_DE = de_DE
 }
 
-module.exports = de_DE
+export default de_DE

+ 11 - 11
packages/@uppy/locales/src/el_GR.js

@@ -1,4 +1,11 @@
-const el_GR = {}
+const el_GR = {
+  pluralize (n) {
+    if (n === 1) {
+      return 1
+    }
+    return 0
+  },
+}
 
 el_GR.strings = {
   addMore: 'Προσθέστε περισσότερα',
@@ -137,15 +144,8 @@ el_GR.strings = {
   },
 }
 
-el_GR.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 1
-  }
-  return 0
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.el_GR = el_GR
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.el_GR = el_GR
 }
 
-module.exports = el_GR
+export default el_GR

+ 11 - 11
packages/@uppy/locales/src/en_US.js

@@ -1,4 +1,11 @@
-const en_US = {}
+const en_US = {
+  pluralize (count) {
+    if (count === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 en_US.strings = {
   addBulkFilesFailed: {
@@ -194,15 +201,8 @@ en_US.strings = {
   zoomOut: 'Zoom out',
 }
 
-en_US.pluralize = function pluralize (count) {
-  if (count === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.en_US = en_US
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.en_US = en_US
 }
 
-module.exports = en_US
+export default en_US

+ 11 - 11
packages/@uppy/locales/src/es_ES.js

@@ -1,4 +1,11 @@
-const es_ES = {}
+const es_ES = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 es_ES.strings = {
   addMoreFiles: 'Agregar más archivos',
@@ -141,15 +148,8 @@ es_ES.strings = {
   openFolderNamed: 'Carpeta abierta %{name}',
 }
 
-es_ES.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.es_ES = es_ES
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.es_ES = es_ES
 }
 
-module.exports = es_ES
+export default es_ES

+ 11 - 11
packages/@uppy/locales/src/fa_IR.js

@@ -1,4 +1,11 @@
-const fa_IR = {}
+const fa_IR = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 fa_IR.strings = {
   addBulkFilesFailed: {
@@ -171,14 +178,7 @@ fa_IR.strings = {
 
 }
 
-fa_IR.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.fa_IR = fa_IR
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.fa_IR = fa_IR
 }
-module.exports = fa_IR
+export default fa_IR

+ 11 - 11
packages/@uppy/locales/src/fi_FI.js

@@ -1,4 +1,11 @@
-const fi_FI = {}
+const fi_FI = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 fi_FI.strings = {
   addMore: 'Lisää',
@@ -144,15 +151,8 @@ fi_FI.strings = {
   recording: 'Tallennetaan',
 }
 
-fi_FI.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.fi_FI = fi_FI
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.fi_FI = fi_FI
 }
 
-module.exports = fi_FI
+export default fi_FI

+ 11 - 11
packages/@uppy/locales/src/fr_FR.js

@@ -1,4 +1,11 @@
-const fr_FR = {}
+const fr_FR = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 fr_FR.strings = {
   addBulkFilesFailed: {
@@ -158,15 +165,8 @@ fr_FR.strings = {
   },
 }
 
-fr_FR.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.fr_FR = fr_FR
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.fr_FR = fr_FR
 }
 
-module.exports = fr_FR
+export default fr_FR

+ 11 - 11
packages/@uppy/locales/src/gl_ES.js

@@ -1,4 +1,11 @@
-const gl_ES = {}
+const gl_ES = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 gl_ES.strings = {
   addMore: 'Engadir máis',
@@ -137,15 +144,8 @@ gl_ES.strings = {
   openFolderNamed: 'Cartafol aberto %{name}',
 }
 
-gl_ES.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.gl_ES = gl_ES
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.gl_ES = gl_ES
 }
 
-module.exports = gl_ES
+export default gl_ES

+ 11 - 11
packages/@uppy/locales/src/he_IL.js

@@ -1,4 +1,11 @@
-const he_IL = {}
+const he_IL = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 he_IL.strings = {
   addMore: 'הוסף עוד',
@@ -139,15 +146,8 @@ he_IL.strings = {
   },
 }
 
-he_IL.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.he_IL = he_IL
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.he_IL = he_IL
 }
 
-module.exports = he_IL
+export default he_IL

+ 11 - 11
packages/@uppy/locales/src/hr_HR.js

@@ -1,4 +1,11 @@
-const hr_HR = {}
+const hr_HR = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 hr_HR.strings = {
   addMore: 'Dodaj još',
@@ -137,15 +144,8 @@ hr_HR.strings = {
   openFolderNamed: 'Otvori mapu %{name}',
 }
 
-hr_HR.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.hr_HR = hr_HR
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.hr_HR = hr_HR
 }
 
-module.exports = hr_HR
+export default hr_HR

+ 8 - 8
packages/@uppy/locales/src/hu_HU.js

@@ -1,4 +1,8 @@
-const hu_HU = {}
+const hu_HU = {
+  pluralize () {
+    return 0
+  },
+}
 
 hu_HU.contributors = ['nagyv']
 
@@ -139,12 +143,8 @@ hu_HU.strings = {
   openFolderNamed: 'Nyitott mappa %{name}',
 }
 
-hu_HU.pluralize = function pluralize () {
-  return 0
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.hu_HU = hu_HU
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.hu_HU = hu_HU
 }
 
-module.exports = hu_HU
+export default hu_HU

+ 11 - 11
packages/@uppy/locales/src/id_ID.js

@@ -1,4 +1,11 @@
-const id_ID = {}
+const id_ID = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 id_ID.strings = {
   addMore: 'Tambahkan lebih banyak',
@@ -137,15 +144,8 @@ id_ID.strings = {
   },
 }
 
-id_ID.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.id_ID = id_ID
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.id_ID = id_ID
 }
 
-module.exports = id_ID
+export default id_ID

+ 11 - 11
packages/@uppy/locales/src/is_IS.js

@@ -1,4 +1,11 @@
-const is_IS = {}
+const is_IS = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 is_IS.strings = {
   addMore: 'Bæta við',
@@ -144,15 +151,8 @@ is_IS.strings = {
   },
 }
 
-is_IS.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.is_IS = is_IS
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.is_IS = is_IS
 }
 
-module.exports = is_IS
+export default is_IS

+ 11 - 11
packages/@uppy/locales/src/it_IT.js

@@ -1,4 +1,11 @@
-const it_IT = {}
+const it_IT = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 it_IT.strings = {
   addMoreFiles: 'Aggiungi più file',
@@ -137,15 +144,8 @@ it_IT.strings = {
   openFolderNamed: 'Cartella aperta %{name}',
 }
 
-it_IT.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.it_IT = it_IT
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.it_IT = it_IT
 }
 
-module.exports = it_IT
+export default it_IT

+ 11 - 11
packages/@uppy/locales/src/ja_JP.js

@@ -1,4 +1,11 @@
-const ja_JP = {}
+const ja_JP = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 ja_JP.strings = {
   addMore: 'さらに追加',
@@ -137,15 +144,8 @@ ja_JP.strings = {
   openFolderNamed: '開いたフォルダ %{name}',
 }
 
-ja_JP.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.ja_JP = ja_JP
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.ja_JP = ja_JP
 }
 
-module.exports = ja_JP
+export default ja_JP

+ 8 - 8
packages/@uppy/locales/src/ko_KR.js

@@ -1,4 +1,8 @@
-const ko_KR = {}
+const ko_KR = {
+  pluralize () {
+    return 0
+  },
+}
 
 ko_KR.strings = {
   addMore: '파일 추가',
@@ -96,12 +100,8 @@ ko_KR.strings = {
   youHaveToAtLeastSelectX: '최소 %{smart_count}개의 파일을 선택해야 합니다',
 }
 
-ko_KR.pluralize = function pluralize () {
-  return 0
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.ko_KR = ko_KR
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.ko_KR = ko_KR
 }
 
-module.exports = ko_KR
+export default ko_KR

+ 11 - 11
packages/@uppy/locales/src/nb_NO.js

@@ -1,4 +1,11 @@
-const nb_NO = {}
+const nb_NO = {
+  pluralize (count) {
+    if (count === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 nb_NO.strings = {
   addBulkFilesFailed: {
@@ -160,15 +167,8 @@ nb_NO.strings = {
   zoomOut: 'Zoom ut',
 }
 
-nb_NO.pluralize = function pluralize (count) {
-  if (count === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.nb_NO = nb_NO
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.nb_NO = nb_NO
 }
 
-module.exports = nb_NO
+export default nb_NO

+ 11 - 11
packages/@uppy/locales/src/nl_NL.js

@@ -1,4 +1,11 @@
-const nl_NL = {}
+const nl_NL = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 nl_NL.strings = {
   addMoreFiles: 'Extra bestanden toevoegen',
@@ -133,15 +140,8 @@ nl_NL.strings = {
   openFolderNamed: 'Open map %{name}',
 }
 
-nl_NL.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.nl_NL = nl_NL
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.nl_NL = nl_NL
 }
 
-module.exports = nl_NL
+export default nl_NL

+ 11 - 11
packages/@uppy/locales/src/pl_PL.js

@@ -1,4 +1,11 @@
-const pl_PL = {}
+const pl_PL = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 pl_PL.strings = {
   addBulkFilesFailed: {
@@ -146,15 +153,8 @@ pl_PL.strings = {
   },
 }
 
-pl_PL.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.pl_PL = pl_PL
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.pl_PL = pl_PL
 }
 
-module.exports = pl_PL
+export default pl_PL

+ 11 - 11
packages/@uppy/locales/src/pt_BR.js

@@ -1,4 +1,11 @@
-const pt_BR = {}
+const pt_BR = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 pt_BR.strings = {
   addMore: 'Adicione mais',
@@ -131,15 +138,8 @@ pt_BR.strings = {
   openFolderNamed: 'Pasta aberta %{name}',
 }
 
-pt_BR.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.pt_BR = pt_BR
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.pt_BR = pt_BR
 }
 
-module.exports = pt_BR
+export default pt_BR

+ 11 - 11
packages/@uppy/locales/src/pt_PT.js

@@ -1,4 +1,11 @@
-const pt_PT = {}
+const pt_PT = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 pt_PT.strings = {
   addMore: 'Adicionar mais',
@@ -131,15 +138,8 @@ pt_PT.strings = {
   openFolderNamed: 'Pasta aberta %{name}',
 }
 
-pt_PT.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.pt_PT = pt_PT
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.pt_PT = pt_PT
 }
 
-module.exports = pt_PT
+export default pt_PT

+ 11 - 11
packages/@uppy/locales/src/ro_RO.js

@@ -1,4 +1,11 @@
-const ro_RO = {}
+const ro_RO = {
+  pluralize (count) {
+    if (count === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 ro_RO.strings = {
   addBulkFilesFailed: {
@@ -136,15 +143,8 @@ ro_RO.strings = {
   },
 }
 
-ro_RO.pluralize = function pluralize (count) {
-  if (count === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.ro_RO = ro_RO
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.ro_RO = ro_RO
 }
 
-module.exports = ro_RO
+export default ro_RO

+ 16 - 16
packages/@uppy/locales/src/ru_RU.js

@@ -1,4 +1,16 @@
-const ru_RU = {}
+const ru_RU = {
+  pluralize (n) {
+    if (n % 10 === 1 && n % 100 !== 11) {
+      return 0
+    }
+
+    if (n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20)) {
+      return 1
+    }
+
+    return 2
+  },
+}
 
 ru_RU.strings = {
   addMoreFiles: 'Добавить еще файлы',
@@ -140,20 +152,8 @@ ru_RU.strings = {
   openFolderNamed: 'Открыть папку %{name}',
 }
 
-ru_RU.pluralize = function pluralize (n) {
-  if (n % 10 === 1 && n % 100 !== 11) {
-    return 0
-  }
-
-  if (n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20)) {
-    return 1
-  }
-
-  return 2
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.ru_RU = ru_RU
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.ru_RU = ru_RU
 }
 
-module.exports = ru_RU
+export default ru_RU

+ 11 - 11
packages/@uppy/locales/src/sk_SK.js

@@ -1,4 +1,11 @@
-const sk_SK = {}
+const sk_SK = {
+  pluralize (count) {
+    if (count === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 sk_SK.strings = {
   addBulkFilesFailed: {
@@ -167,15 +174,8 @@ sk_SK.strings = {
   zoomOut: 'Oddialiť',
 }
 
-sk_SK.pluralize = function pluralize (count) {
-  if (count === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.sk_SK = sk_SK
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.sk_SK = sk_SK
 }
 
-module.exports = sk_SK
+export default sk_SK

+ 1 - 1
packages/@uppy/locales/src/sr_RS_Cyrillic.js

@@ -148,4 +148,4 @@ if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
   window.Uppy.locales.sr_RS_Cyrillic = sr_RS_Cyrillic
 }
 
-module.exports = sr_RS_Cyrillic
+export default sr_RS_Cyrillic

+ 1 - 1
packages/@uppy/locales/src/sr_RS_Latin.js

@@ -148,4 +148,4 @@ if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
   window.Uppy.locales.sr_RS_Latin = sr_RS_Latin
 }
 
-module.exports = sr_RS_Latin
+export default sr_RS_Latin

+ 11 - 11
packages/@uppy/locales/src/sv_SE.js

@@ -1,4 +1,11 @@
-const sv_SE = {}
+const sv_SE = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 sv_SE.strings = {
   addMore: 'Lägg till',
@@ -137,15 +144,8 @@ sv_SE.strings = {
   },
 }
 
-sv_SE.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.sv_SE = sv_SE
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.sv_SE = sv_SE
 }
 
-module.exports = sv_SE
+export default sv_SE

+ 11 - 11
packages/@uppy/locales/src/th_TH.js

@@ -1,4 +1,11 @@
-const th_TH = {}
+const th_TH = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 th_TH.strings = {
   addBulkFilesFailed: {
@@ -156,15 +163,8 @@ th_TH.strings = {
   zoomOut: 'ซูมออก',
 }
 
-th_TH.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.th_TH = th_TH
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.th_TH = th_TH
 }
 
-module.exports = th_TH
+export default th_TH

+ 11 - 11
packages/@uppy/locales/src/tr_TR.js

@@ -1,4 +1,11 @@
-const tr_TR = {}
+const tr_TR = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 tr_TR.strings = {
   addMore: 'Daha ekle',
@@ -137,15 +144,8 @@ tr_TR.strings = {
   openFolderNamed: 'Açık dosya %{name}',
 }
 
-tr_TR.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.tr_TR = tr_TR
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.tr_TR = tr_TR
 }
 
-module.exports = tr_TR
+export default tr_TR

+ 16 - 16
packages/@uppy/locales/src/uk_UA.js

@@ -1,4 +1,16 @@
-const uk_UA = {}
+const uk_UA = {
+  pluralize (n) {
+    if (n % 10 === 1 && n % 100 !== 11) {
+      return 0
+    }
+
+    if (n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20)) {
+      return 1
+    }
+
+    return 2
+  },
+}
 
 uk_UA.strings = {
   addMoreFiles: 'Додати ще файли',
@@ -137,20 +149,8 @@ uk_UA.strings = {
   openFolderNamed: 'Відкрити теку %{name}',
 }
 
-uk_UA.pluralize = function pluralize (n) {
-  if (n % 10 === 1 && n % 100 !== 11) {
-    return 0
-  }
-
-  if (n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20)) {
-    return 1
-  }
-
-  return 2
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.uk_UA = uk_UA
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.uk_UA = uk_UA
 }
 
-module.exports = uk_UA
+export default uk_UA

+ 11 - 11
packages/@uppy/locales/src/vi_VN.js

@@ -1,4 +1,11 @@
-const vi_VN = {}
+const vi_VN = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 vi_VN.strings = {
   addMore: 'Thêm',
@@ -140,15 +147,8 @@ vi_VN.strings = {
   },
 }
 
-vi_VN.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.vi_VN = vi_VN
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.vi_VN = vi_VN
 }
 
-module.exports = vi_VN
+export default vi_VN

+ 4 - 6
packages/@uppy/locales/src/zh_CN.js

@@ -1,4 +1,4 @@
-const zh_CN = {}
+const zh_CN = { pluralize () { return 0 } }
 
 zh_CN.strings = {
   addBulkFilesFailed: '内部错误导致添加 %{smart_count} 个文件失败',
@@ -111,10 +111,8 @@ zh_CN.strings = {
 }
 
 // There is just one form.
-zh_CN.pluralize = function pluralize () { return 0 }
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.zh_CN = zh_CN
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.zh_CN = zh_CN
 }
 
-module.exports = zh_CN
+export default zh_CN

+ 11 - 11
packages/@uppy/locales/src/zh_TW.js

@@ -1,4 +1,11 @@
-const zh_TW = {}
+const zh_TW = {
+  pluralize (n) {
+    if (n === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 zh_TW.strings = {
   addBulkFilesFailed: {
@@ -146,15 +153,8 @@ zh_TW.strings = {
   },
 }
 
-zh_TW.pluralize = function pluralize (n) {
-  if (n === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.zh_TW = zh_TW
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.zh_TW = zh_TW
 }
 
-module.exports = zh_TW
+export default zh_TW

+ 11 - 11
packages/@uppy/locales/template.js

@@ -1,16 +1,16 @@
-const en_US = {}
+const en_US = {
+  pluralize (count) {
+    if (count === 1) {
+      return 0
+    }
+    return 1
+  },
+}
 
 en_US.strings = {}
 
-en_US.pluralize = function pluralize (count) {
-  if (count === 1) {
-    return 0
-  }
-  return 1
-}
-
-if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
-  window.Uppy.locales.en_US = en_US
+if (typeof Uppy !== 'undefined') {
+  globalThis.Uppy.locales.en_US = en_US
 }
 
-module.exports = en_US
+export default en_US