-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix "terms" #2767
Fix "terms" #2767
Conversation
Create a function in update_locales.js that: * lowercases all "terms" translations in presets (fixes #2756) * converts comma-space separators into just comma separators (saves a little bit of bandwidth and processing power on clients)
Ran `make translations` Note that make translations has been improved by the previous commit.
Also, IMO this deserves a release; it fixes a subtle issue that may be confusing to end users. :) |
to clarify that preset.terms is made lowercase upon retrieval from Transifex
Yes it does. Instead of matching a tag exactly by its term, it will be matching by leventshtein distance for a cost of ... "1 space before everything". And this is, IMO, wrong. By the way I think you should do more check on spaces around comma; some common typos are:
I think that the script should totally remove |
You're right, again.
Spaces at the end don't have as much impact but I'm going to remove them in this PR, thanks. I also searched for semicolons ( |
Can now also handle e.g.: * ` ,` * ` ,, ` * `, ` Change function definition of deepNormalizeTerms to the convention within this file
Best not pull the translations right now: |
I agree we should really do a release.. Lets let the translators catch up with "Allowed Access" and try to push a release in few days. Regarding this change to fix the terms: I like what you're doing, but I think it might be better to make the original fix
So our presets code really needs to handle the possibility that the terms list may have bad data in it. |
Shall I leave the code in update-locales.js as well, or omit it? It really doesn't matter that much. NL is 139.8 KiB without the normalization, 139.3 KiB with. I'll open a new PR when I've modified it. Feel free to close this one. |
Yeah, skip the
I think we can wait - Monday is a holiday here in the US.. Let's shoot for Tuesday? |
"terms" lists that were not fully lowercase cannot be handled. This PR counters this by processing the "terms" list upon retrieval of the translations from Transifex.
At first, I changed
./js/id/presets/preset.js # 49
to include a.toLowerCase()
but it made more sense to just make sure the value is already OK in the./dist/locales/##.json
files.While we're at it, the processing function also removes spaces after commas in the terms list.
Those did not seem to affect the behaviour of the app, butUpdate: Those also put a penalty on the affected terms. As a free extra, removing them saves some bytes on the transmission of locale files and maybe even improves performance a tiny tiny bit, but I'm not sure.Overall, it's just nicer that they are normalized and the effort to do it is not so great since we have to process them all anyway.[Statement irrelevant: they need to be corrected.]Fixes #2756.