Skip to content

Commit

Permalink
Merge pull request #1026 from AmadeusITGroup/feat/lang
Browse files Browse the repository at this point in the history
feat: prefetch localization
  • Loading branch information
sdo-1A authored Oct 13, 2023
2 parents 72d5f49 + a005f9c commit df8bade
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/templates/prefetch.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@

var resList = {{{resourceArray}}};
var fullPath = '{{{staticsFullPath}}}';
var shamefulString = 'STATICS_FULL_PATH';
var staticsFullPathKey = 'STATICS_FULL_PATH';
// for testing
if (fullPath === `{${shamefulString}}`) { fullPath = '.'; }
if (fullPath === `{${staticsFullPathKey}}`) { fullPath = '.'; }

var language = '{LANG}';
var languageKey = 'LANG';
if (language !== `{${languageKey}}`) {
resList.push(`/localizations/${language}.json`);
}

resList.forEach(function(resource) {
if (typeof resource === 'string') {
var splitRes = resource.split('.');
Expand Down

0 comments on commit df8bade

Please sign in to comment.