-
Notifications
You must be signed in to change notification settings - Fork 115
Add French localization for QueueServer messages #3640
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
Conversation
|
Just a hint: I think |
|
In the past, I encountered issues when trying to use accented characters directly in .properties files without escaping them in Unicode. Has this behavior been fixed since Java 17? In other words, is it now possible to use UTF-8 encoded .properties files without any reading issues? I have to admit, this would make translation work much easier. |
|
@XavSPM, I would assume support for UTF-8 has been around before Java 17. That said, I'm not sure if accented characters will survive the Github roundtrip :-). |
|
It might not be about Java 17. UTF-8 has been around longer, but we didn't always include |
|
@XavSPM do you want to try to us the accented char's in this PR... I will wait before merging it. |
|
After running several tests, it turns out that it is no longer necessary to use Unicode escape sequences for accented characters. The simplest solution, in my view, would be to:
Python script: #!/usr/bin/env python3
import os
import re
def decode_unicode_escapes(text: str) -> str:
"""Converts \\uXXXX sequences into real Unicode characters."""
return re.sub(r'\\u([0-9a-fA-F]{4})',
lambda m: chr(int(m.group(1), 16)),
text)
def convert_file(path: str):
"""Converts a .properties file in place."""
with open(path, 'r', encoding='utf-8', errors='ignore') as fin:
original = fin.read()
converted = decode_unicode_escapes(original)
# Rewrite only if content has changed
if converted != original:
with open(path, 'w', encoding='utf-8', newline='\n') as fout:
fout.write(converted)
print(f"✅ Updated: {path}")
else:
print(f"↔️ Unchanged: {path}")
def main(root_dir: str):
"""Recursively scans all subdirectories for messages_fr.properties files."""
for dirpath, _, filenames in os.walk(root_dir):
for name in filenames:
if name == "messages_fr.properties":
full_path = os.path.join(dirpath, name)
convert_file(full_path)
if __name__ == "__main__":
import sys
if len(sys.argv) != 2:
print("Usage: python3 convert_utf8_replace.py <root_directory>")
sys.exit(1)
main(sys.argv[1])
""" |
|
@XavSPM, do you wish to run that script on all messages file for FR and update the PR? |
|
I’ll take a look as soon as possible. I’m just a bit surprised that the file When I run:
I get:
I’m glad you like my work, but I’m only doing the translations. |
|
I think the messages.properties was changed cause the EOL changed from CRLF to LF |
Checklist
Testing:
Documentation: