Skip to content

Commit f8dcd95

Browse files
authored
Merge pull request #7878 from processing/fes-version
Use FES internationalization within the minor version
2 parents cc6f083 + 309c082 commit f8dcd95

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/core/internationalization.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import i18next from 'i18next';
22
import LanguageDetector from 'i18next-browser-languagedetector';
3+
import { VERSION } from './constants';
4+
35

46
let fallbackResources, languages;
57
if (typeof IS_MINIFIED === 'undefined') {
@@ -149,8 +151,12 @@ export const initialize = () => {
149151
},
150152
backend: {
151153
fallback: 'en',
152-
loadPath:
153-
'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`
154160
},
155161
partialBundledLanguages: true,
156162
resources: fallbackResources

0 commit comments

Comments
 (0)