-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Added command line parameter to not create zim for languages with variants #206
Conversation
@pavel-karatsiuba thx but:
|
@@ -81,6 +81,9 @@ const fetchLanguages = async (): Promise<void> => { | |||
rows.forEach((item) => { | |||
const url = $(item).find('td.list-highlight-background:first-child a').attr('href') | |||
const slug = /locale=(.*)$/.exec(url)?.pop() | |||
if (argv.withoutLanguageVariants && slug.includes('_')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have a log entry
@@ -81,6 +81,9 @@ const fetchLanguages = async (): Promise<void> => { | |||
rows.forEach((item) => { | |||
const url = $(item).find('td.list-highlight-background:first-child a').attr('href') | |||
const slug = /locale=(.*)$/.exec(url)?.pop() | |||
if (argv.withoutLanguageVariants && slug.includes('_')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not be based on the slug, but on the lang. This is not robust.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slug it just a variable name. It is filled from the locale
part of the URL.
All other steps and functions use the value from this variable to define the language.
README.md
Outdated
@@ -30,6 +30,13 @@ npm i && npm start | |||
The above will eventually output a ZIM file to ```dist/``` | |||
|
|||
## Command line arguments | |||
`--withoutLanguageVariants` uses to exclude languages with County variant. For example `en_ca` will not be present in zim with this argument. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
README.md
Outdated
@@ -30,6 +30,13 @@ npm i && npm start | |||
The above will eventually output a ZIM file to ```dist/``` | |||
|
|||
## Command line arguments | |||
`--withoutLanguageVariants` uses to exclude languages with County variant. For example `en_ca` will not be present in zim with this argument. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that not "en-CA"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the phet site, we are getting "en_CA"
@@ -81,6 +81,9 @@ const fetchLanguages = async (): Promise<void> => { | |||
rows.forEach((item) => { | |||
const url = $(item).find('td.list-highlight-background:first-child a').attr('href') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix problems
Description typos fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Metadata
Language
is not supporting language with variants, for example, 'en_CA'.With this PR added the command line parameter
--withoutLanguageVariants
which filters the language list and removes languages with variants.This means that if the user uses the parameter
--withoutLanguageVariants
then zim files for languages with variants will not be created.Fix: #204