mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-02-17 13:52:14 +01:00
🌐 Sync Translations + Update README Progress Table (#4783)
# Description of Changes 1. Synchronization of Translation Files Updated translation files (messages_*.properties) to reflect changes in the reference file messages_en_GB.properties. Ensured consistency and synchronization across all supported language files. Highlighted any missing or incomplete translations. 2. Update README.md Generated the translation progress table in README.md. Added a summary of the current translation status for all supported languages. Included up-to-date statistics on translation coverage. --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details.
This commit is contained in:
@@ -79,6 +79,25 @@ def write_readme(progress_list: list[tuple[str, int]]) -> None:
|
||||
file.writelines(content)
|
||||
|
||||
|
||||
def load_reference_keys(default_file_path: str) -> set[str]:
|
||||
"""Reads ALL keys from the reference file (excluding comments and empty lines)."""
|
||||
keys: set[str] = set()
|
||||
with open(default_file_path, encoding="utf-8") as f:
|
||||
for _ in range(5):
|
||||
try:
|
||||
next(f)
|
||||
except StopIteration:
|
||||
break
|
||||
|
||||
for line in f:
|
||||
s = line.strip()
|
||||
if not s or s.startswith("#") or "=" not in s:
|
||||
continue
|
||||
k, _ = s.split("=", 1)
|
||||
keys.add(k.strip().replace("\ufeff", "")) # BOM protection
|
||||
return keys
|
||||
|
||||
|
||||
def compare_files(
|
||||
default_file_path, file_paths, ignore_translation_file
|
||||
) -> list[tuple[str, int]]:
|
||||
@@ -99,6 +118,8 @@ def compare_files(
|
||||
if line.strip() and not line.strip().startswith("#")
|
||||
)
|
||||
|
||||
ref_keys: set[str] = load_reference_keys(default_file_path)
|
||||
|
||||
result_list = []
|
||||
sort_ignore_translation: tomlkit.TOMLDocument
|
||||
|
||||
@@ -130,6 +151,16 @@ def compare_files(
|
||||
["language.direction"]
|
||||
)
|
||||
|
||||
# Clean up ignore list to only include keys present in reference
|
||||
sort_ignore_translation[language]["ignore"] = [
|
||||
key for key in sort_ignore_translation[language]["ignore"]
|
||||
if key in ref_keys or key == "language.direction"
|
||||
]
|
||||
|
||||
# debug: add all keys from ref to ignore
|
||||
# sort_ignore_translation[language]["ignore"] = list(ref_keys)
|
||||
# continue # debug end
|
||||
|
||||
# if "missing" not in sort_ignore_translation[language]:
|
||||
# sort_ignore_translation[language]["missing"] = tomlkit.array()
|
||||
# elif "language.direction" in sort_ignore_translation[language]["missing"]:
|
||||
@@ -153,6 +184,7 @@ def compare_files(
|
||||
# Ignoring empty lines and lines start with #
|
||||
if line_default.strip() == "" or line_default.startswith("#"):
|
||||
continue
|
||||
|
||||
default_key, default_value = line_default.split("=", 1)
|
||||
file_key, file_value = line_file.split("=", 1)
|
||||
if (
|
||||
|
||||
@@ -318,10 +318,10 @@ ignore = [
|
||||
|
||||
[fr_FR]
|
||||
ignore = [
|
||||
'addPageNumbers.selectText.3',
|
||||
'AddStampRequest.alphabet',
|
||||
'AddStampRequest.position',
|
||||
'AddStampRequest.rotation',
|
||||
'addPageNumbers.selectText.3',
|
||||
'adminUserSettings.actions',
|
||||
'alphabet',
|
||||
'audit.dashboard.modal.id',
|
||||
|
||||
Reference in New Issue
Block a user