Skip to content

Commit

Permalink
Use our very own handlebars-i18next-parser (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed Mar 31, 2022
1 parent 54e4d43 commit e63744b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
6 changes: 2 additions & 4 deletions frontend/gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { JSDOM, VirtualConsole } from 'jsdom';
import * as through2 from 'through2';
import chalk from 'chalk';
import { gulp as i18nextParser } from 'i18next-parser';
import HbsI18nLexer from 'handlebars-i18next-parser';


type LibraryProps = {
Expand Down Expand Up @@ -296,10 +297,7 @@ export function i18nParse() {
locales: ['en', 'fr'],
output: `${i18nDir}/$LOCALE/$NAMESPACE.json`,
lexers: {
hbs: [{
lexer: 'HandlebarsLexer',
functions: ['i18n'],
}],
hbs: [HbsI18nLexer],
},
}))
.pipe(dest('.'));
Expand Down
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@
"gulp-sass": "^5.0.0",
"gulp-sourcemaps": "^2.6.4",
"gulp-uglify": "^3.0.1",
"i18next-parser": "^5.0.0",
"handlebars-i18next-parser": "^1.0.1",
"http-proxy-middleware": "^0.19.0",
"i18next-parser": "^6.0.1",
"jasmine-ajax": "^4.0.0",
"jasmine-core": "~3.5.0",
"jasmine-terminal-reporter": "^1.0.3",
Expand Down
45 changes: 26 additions & 19 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2520,10 +2520,10 @@ combined-stream@^1.0.6, combined-stream@~1.0.6:
dependencies:
delayed-stream "~1.0.0"

commander@~8.3.0:
version "8.3.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66"
integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==
commander@~9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-9.1.0.tgz#a6b263b2327f2e188c6402c42623327909f2dbec"
integrity sha512-i0/MaqBtdbnJ4XQs4Pmyb+oFQl+q0lsAmokVUH92SlSw4fkeAcG3bVon+Qt7hmtF+u3Het6o4VgrcY3qAoEB6w==

component-emitter@^1.2.1:
version "1.3.0"
Expand Down Expand Up @@ -4325,6 +4325,13 @@ gulplog@^1.0.0:
dependencies:
glogg "^1.0.0"

handlebars-i18next-parser@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/handlebars-i18next-parser/-/handlebars-i18next-parser-1.0.1.tgz#b5334c7a3b6c534c5ec9699766cdbb1fa30866d3"
integrity sha512-KYiD0XsSy5rVladnR5CR2coUDGEMDFeFXQZo0KMMKc4e5a+g9wiQQN6ORfI+Fn04UDtB5rOAVL6UmhbwzOiVkA==
dependencies:
i18next-parser "^6.0.1"

handlebars-i18next@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/handlebars-i18next/-/handlebars-i18next-1.0.1.tgz#e810e37b4022d7f7a5eca85c00dd51092d1b4eff"
Expand Down Expand Up @@ -4640,24 +4647,24 @@ i18next-browser-languagedetector@^2.2.3:
resolved "https://registry.yarnpkg.com/i18next-browser-languagedetector/-/i18next-browser-languagedetector-2.2.4.tgz#b02412d7ab15d7d74e1b1317d67d8a244b219ee3"
integrity sha512-wPbtH18FdOuB245I8Bhma5/XSDdN/HpYlX+wga1eMy+slhaFQSnrWX6fp+aYSL2eEuj0RlfHeEVz6Fo/lxAj6A==

i18next-parser@^5.0.0:
version "5.4.0"
resolved "https://registry.yarnpkg.com/i18next-parser/-/i18next-parser-5.4.0.tgz#ba69a41a2b636f15a1bdfd50aadabc9ec397b335"
integrity sha512-AkMOy3NW09tnB+4CAVzHVWxhoab8q1L6E3aIugWeTZqbUVYTjb6dtW1AhiiUd4nLMOj29LaaVCkyqOhrTezp7Q==
i18next-parser@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/i18next-parser/-/i18next-parser-6.0.1.tgz#2cd7e5ec8433ecd86a5d86e52f7b2d5929726009"
integrity sha512-t+nU0WCX6ntuBu9ILhT3mk1tigYxAJuSj5nfdsCu+5zItOAOtuA+Kl550xqKLQ3Y1QhXpHz2qxEtcpfww3Vm4A==
dependencies:
"@babel/runtime" "^7.15.4"
broccoli-plugin "^4.0.7"
cheerio "^1.0.0-rc.2"
colors "1.4.0"
commander "~8.3.0"
commander "~9.1.0"
concat-stream "~2.0.0"
eol "^0.9.1"
fs-extra "^10.0.0"
gulp-sort "^2.0.0"
i18next "^21.2.0"
js-yaml "4.1.0"
rsvp "^4.8.2"
sort-keys "^4.2.0"
sort-keys "^5.0.0"
through2 "~4.0.2"
typescript "^4.2.4"
vinyl "~2.2.1"
Expand Down Expand Up @@ -5048,10 +5055,10 @@ is-plain-obj@^1.1.0:
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e"
integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4=

is-plain-obj@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287"
integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==
is-plain-obj@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-4.0.0.tgz#06c0999fd7574edf5a906ba5644ad0feb3a84d22"
integrity sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==

is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4:
version "2.0.4"
Expand Down Expand Up @@ -8145,12 +8152,12 @@ snapdragon@^0.8.1:
source-map-resolve "^0.5.0"
use "^3.1.0"

sort-keys@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-4.2.0.tgz#6b7638cee42c506fff8c1cecde7376d21315be18"
integrity sha512-aUYIEU/UviqPgc8mHR6IW1EGxkAXpeRETYcrzg8cLAvUPZcpAlleSXHV2mY7G12GphSH6Gzv+4MMVSSkbdteHg==
sort-keys@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-5.0.0.tgz#5d775f8ae93ecc29bc7312bbf3acac4e36e3c446"
integrity sha512-Pdz01AvCAottHTPQGzndktFNdbRA75BgOfeT1hH+AMnJFv8lynkPi42rfeEhpx1saTEI3YNMWxfqu0sFD1G8pw==
dependencies:
is-plain-obj "^2.0.0"
is-plain-obj "^4.0.0"

source-map-resolve@^0.5.0, source-map-resolve@^0.5.2:
version "0.5.3"
Expand Down

0 comments on commit e63744b

Please sign in to comment.