Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate language list dynamically #125

Open
blazeu opened this issue Jan 2, 2018 · 2 comments
Open

Generate language list dynamically #125

blazeu opened this issue Jan 2, 2018 · 2 comments

Comments

@blazeu
Copy link
Member

blazeu commented Jan 2, 2018

var localeOptions = {
English: 'en',
Español: 'es',
Polski: 'pl',
'Norwegian Bokmål': 'nb_NO',
}

It needs to be generated dynamically, from the locale files that exists in static/i18n to support #124.

We can generate a JSON file and import that file to replace the JS object in locale.js

The language name can come from a npm package, but do not include that package in the client side js as to not bloat it.

@blazeu blazeu changed the title Remove locale list on js file Generate locale list dynamically Jan 2, 2018
@blazeu blazeu changed the title Generate locale list dynamically Generate language list dynamically Jan 2, 2018
@mooncos
Copy link
Member

mooncos commented Jan 14, 2018

I have an issue with this. Webpack bundles all js files before I can add my own with the translations hash list.

@blazeu
Copy link
Member Author

blazeu commented Jan 14, 2018

You should take advantage of the bundling, use import to import that hash/object json file.

The file should be generated before the bundling happens, obviously.

mooncos added a commit to mooncos/gci-leaders that referenced this issue Jan 14, 2018
This adds ``langParser.js`` to generate the available
language list automatically from available translation
files. This also adds a npm script for generating before
webpack bundles. Modifies .gitignore so that generated
``languages.js`` file is ignored.

Closes: coala#125
mooncos added a commit to mooncos/gci-leaders that referenced this issue Jan 14, 2018
This adds ``langParser.js`` to generate the available
language list automatically from available translation
files. This also adds a npm script for generating before
webpack bundles. Modifies .gitignore so that generated
``languages.js`` file is ignored. Adds tests. Renames
``nb_NO.json`` to ``nb-NO.json`` to comply with RFC
standards.

Closes: coala#125
mooncos added a commit to mooncos/gci-leaders that referenced this issue Jan 15, 2018
This adds ``langParser.js`` to generate the available
language list automatically from available translation
files. This also adds a npm script for generating before
webpack bundles. Modifies .gitignore so that generated
``languages.js`` file is ignored. Adds tests. Renames
``nb_NO.json`` to ``nb-NO.json`` to comply with RFC
standards.

Closes: coala#125
mooncos added a commit to mooncos/gci-leaders that referenced this issue Jan 15, 2018
This adds ``langParser.js`` to generate the available
language list automatically from available translation
files. This also adds a npm script for generating before
webpack bundles. Modifies .gitignore so that generated
``languages.js`` file is ignored. Adds tests. Renames
``nb_NO.json`` to ``nb-NO.json`` to comply with RFC
standards.

Closes: coala#125
mooncos added a commit to mooncos/gci-leaders that referenced this issue Jan 15, 2018
This adds ``langParser.js`` to generate the available
language list automatically from available translation
files. This also adds a npm script for generating before
webpack bundles. Modifies .gitignore so that generated
``languages.js`` file is ignored. Adds tests.

Closes: coala#125
mooncos added a commit to mooncos/gci-leaders that referenced this issue Jan 15, 2018
This adds ``langParser.js`` to generate the available
language list automatically from available translation
files. This also adds a npm script for generating before
webpack bundles. Modifies .gitignore so that generated
``languages.js`` file is ignored. Adds tests.

Closes: coala#125
supunTE added a commit to supunTE/gci-leaders that referenced this issue Dec 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants