File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 11import i18next from 'i18next' ;
22import LanguageDetector from 'i18next-browser-languagedetector' ;
3- import * as constants from './constants' ;
3+ import { VERSION } from './constants' ;
44
55
66let fallbackResources , languages ;
@@ -129,7 +129,6 @@ export let translator = (key, values) => {
129129 * Set up our translation function, with loaded languages
130130 */
131131export const initialize = ( ) => {
132- let latestMinorVersionPath = 'https://cdn.jsdelivr.net/npm/p5@' + constants . VERSION . replace ( / ^ ( \d + \. \d + ) \. \d + .* $ / , '$1' ) ;
133132 let i18init = i18next
134133 . use ( LanguageDetector )
135134 . use ( FetchResources )
@@ -152,7 +151,12 @@ export const initialize = () => {
152151 } ,
153152 backend : {
154153 fallback : 'en' ,
155- loadPath : latestMinorVersionPath + '/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`
156160 } ,
157161 partialBundledLanguages : true ,
158162 resources : fallbackResources
You can’t perform that action at this time.
0 commit comments