-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
locale can be longer than just 2 letter code #86
Comments
Thanks for reporting this. I agree we should support this, using a 2-letter locale is an unnecessary simplification. I'm thinking of writing a kind of validation function, that depending on the Separate locale input is also something to be considered. Great for developers that want to use multiple time formats in a theme, but also additional cognitive overhead for regular users. Will give it some thought next time I work on this plugin. In the meantime I could remove the assertion if that helps your use-case? |
For me, I can just use JavaScript to change the strings afterwards, and I don't need to specify the sub-language tag right now, thus I'm not in a hurry. The need is focused on |
A new assertion of 2-letter locale codes was added into one dependency and broke the page build. This should not have happened, but needs to be worked around anyway. This can be reverted once timvink/mkdocs-git-revision-date-localized-plugin#86 is fixed.
Agree would be good to change - I was trying using |
It is recommended to remove this restriction first. This will be very helpful for Chinese-speaking countries. For us, it is the same as zh but there are more than three differences. |
@jonaharagon agree with you /cc @timvink |
Any update? I'm trying to use pt-br |
For this assertion:
mkdocs-git-revision-date-localized-plugin/mkdocs_git_revision_date_localized_plugin/plugin.py
Line 117 in 708128b
...and the way
locale
is used:mkdocs-git-revision-date-localized-plugin/mkdocs_git_revision_date_localized_plugin/util.py
Line 9 in 708128b
mkdocs-git-revision-date-localized-plugin/mkdocs_git_revision_date_localized_plugin/util.py
Line 72 in 708128b
mkdocs-git-revision-date-localized-plugin/mkdocs_git_revision_date_localized_plugin/js/timeago_mkdocs_material.js
Line 9 in 9747e59
...and the document of Babel and timeago:
Instead of just 2 letter code,
locale
also support longer format likeen_US
, or even:date
,datetime
...),en_short
.etc fortimeago
.This assertion should be lifted, and document of this plugin may be changed accordingly, from ISO 639-1 to the document of Babel and timeago.
Change locale to
locale: { default: en, babel: en_US, timeago: en_short }
or:... may also be considered.
The text was updated successfully, but these errors were encountered: