-
Notifications
You must be signed in to change notification settings - Fork 0
Multiple fixes - not ideal to be combined in a single PR, but here we are. #65
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
base: main
Are you sure you want to change the base?
Conversation
rmpel
commented
Jul 30, 2025
- Update POT, add translations and update the compiled files.
- Add NPM commands for i18n management.
- Contact requests should not go through info@acato.nl. A better option should be created, but for now, use service with a tag.
- The fix that started this entire PR - Early Output breaking the website and more issues, see code comments for details.
… should be created, but for now, use service with a tag.
…te and more issues, see code comments
| @@ -1 +1 @@ | |||
| {"translation-revision-date":"2024-08-13 16:54+0200","generator":"WP-CLI\/2.8.1","source":"src\/blocks\/owc-openkaarten\/streetmap\/assets\/scripts\/edit.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"nl_NL","plural-forms":"nplurals=2; plural=(n != 1);"},"Select the datalayers you want to display on the map":["Selecteer de datalayers die getoond dienen te worden op de kaart"],"No datalayers selected":["Geen datalayers geselecteerd"],"Select datalayers:":["Selecteer datalayers"],"Selected datalayers":["Geselecteerde datalayers"]}}} No newline at end of file | |||
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.
Klopt dit wel? Er worden nu Nederlandse vertalingen verwijderd.
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.
ik zal kijken wat ik kan repareren, maar bijvoorbeeld de string "Select the datalayers you want to display on the map" zit niet in het PO bestand in main. gezien ik afgetakt ben van main ...
Hoe het in de JSON terecht gekomen is, is mij onbekend, maar er zijn 2 wijzigingen in de PO file op main
1 is de initiele opzet van jou; zit deze string niet in
2 is een eerdere merge van mij, die niet aan deze tekst iets wijzigt (want wat er niet is kun je niet wijzigen)
Wederom een vertaal-bestand-raadsel ...
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.
npm run make-json verwijderd de missende regels uit de PO file ... - investigating ...
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.
Updated, please re-review @richardkorthuis
includes/class-i18n.php
Outdated
|
|
||
| return false; | ||
| /** | ||
| * To be discussed; Why did I remove this? (RP 2025-07-30) |
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.
Ik zou dit soort comments niet in publieke code plaatsen. Verwijder gewoon de naar jouw mening foute code en plaats je redenering eventueel in de commit message.
To be discussed; Why did I remove this? (RP 2025-07-30) 1. $locale using get_locale() is the site locale, not the user locale. - The user locale could be different, so this is not correct. I noticed this during debugging, load_plugin_textdomain uses determine_locale(), not get_locale(). 2. The path displayed here is not correct; the correct path is $path/$textdomain-$locale.mo. So in my case, the error was `Could not find openkaarten-frontend-plugin/languages//nl_NL.mo` while it should have been `Could not find openkaarten-frontend-plugin/languages/openkaarten-frontend-plugin-en_US.mo` 3. We'll ignore the double slash for now 4. This error message is printed before any legitimate output, breaking every POST, potentially breaking every AJAX/REST call and at the minimum showing the error in raw HTML. At least this should be an error_log, but preferably a wrapper into Admin Notices. In my case it only broke wp-admin as I have set Admin to English whereas the site is in Dutch, but in case of a non-NL site, this would break the site. 5. Since all source texts are in English; at least, the error should not show on `en_*` locales. 6. Finally, the filter construction here is interesting; It is only used here, so it doesn't do anything, also, the expected intention is to allow the user to change the locale using a filter, but that is not how WordPress works (unfortunately).
… decided to remove the items from PO and MO. MO I can understand, because JS strings are not needed in PHP, but removing them from PO means removing them from JSON as well, next run. wp-cli/i18n-command#453