We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cc6f083 + 309c082 commit f8dcd95Copy full SHA for f8dcd95
1 file changed
src/core/internationalization.js
@@ -1,5 +1,7 @@
1
import i18next from 'i18next';
2
import LanguageDetector from 'i18next-browser-languagedetector';
3
+import { VERSION } from './constants';
4
+
5
6
let fallbackResources, languages;
7
if (typeof IS_MINIFIED === 'undefined') {
@@ -149,8 +151,12 @@ export const initialize = () => {
149
151
},
150
152
backend: {
153
fallback: 'en',
- loadPath:
- 'https://cdn.jsdelivr.net/npm/p5/translations/{{lng}}/{{ns}}.json'
154
155
+ // ensure that the FES internationalization strings are loaded
156
+ // from the latest patch of the current minor version of p5.js
157
+ loadPath: `https://cdn.jsdelivr.net/npm/p5@${
158
+ VERSION.replace(/^(\d+\.\d+)\.\d+.*$/, '$1')
159
+ }/translations/{{lng}}/{{ns}}.json`
160
161
partialBundledLanguages: true,
162
resources: fallbackResources
0 commit comments