i18n: translating script sort by keys to keep things nice and tidy + re-translated some modified english translations.

This commit is contained in:
ItsLemmy
2025-11-03 21:28:54 -05:00
parent aed68220fd
commit d262b84b41
10 changed files with 12324 additions and 12311 deletions
+1745 -1745
View File
File diff suppressed because it is too large Load Diff
+1758 -1758
View File
File diff suppressed because it is too large Load Diff
+1740 -1740
View File
File diff suppressed because it is too large Load Diff
+1742 -1742
View File
File diff suppressed because it is too large Load Diff
+1742 -1742
View File
File diff suppressed because it is too large Load Diff
+41 -41
View File
@@ -159,6 +159,7 @@
}
},
"lock-keys": {
"browse": "Göz at",
"show-caps-lock": {
"description": "Caps Lock durumunu göster.",
"label": "Caps Lock"
@@ -170,8 +171,7 @@
"show-scroll-lock": {
"description": "Scroll Lock durumunu göster.",
"label": "Scroll Lock"
},
"browse": "Göz at"
}
},
"media-mini": {
"hide-mode": {
@@ -439,10 +439,10 @@
"center": "Merkez (varsayılan)",
"center_left": "Sol merkez",
"center_right": "Sağ merkez",
"follow_bar": "Çubuğu takip et (varsayılan)",
"top_center": "Üst merkez",
"top_left": "Sol üst",
"top_right": "Sağ üst",
"follow_bar": "Çubuğu takip et (varsayılan)"
"top_right": "Sağ üst"
}
},
"osd": {
@@ -500,6 +500,7 @@
"command-example": "echo \"Hello World\"",
"enter-command": "Çalıştırılacak komutu girin (uygulama veya özel komut)",
"enter-text-to-collapse": "örn., 'nothing is playing'. Desenler için /regex/ kullanın.",
"enter-tooltip": "Araç ipucunu girin",
"enter-width-pixels": "Genişliği piksel olarak girin",
"profile-picture-path": "/home/user/.face",
"search": "Ara...",
@@ -507,8 +508,7 @@
"search-launcher": "Girişleri arayın... veya > komutları için kullanın",
"search-wallpapers": "Duvar kağıtlarını filtrelemek için yazın...",
"select": "Seç",
"test": "Test",
"enter-tooltip": "Araç ipucunu girin"
"test": "Test"
},
"plugins": {
"applications": "Uygulamalar",
@@ -730,6 +730,10 @@
"label": "Kenar boşlukları",
"vertical": "Dikey"
},
"outer-corners": {
"description": "Çubuğun dışa doğru kavisli köşelerini görüntüler.",
"label": "Dış köşeler"
},
"position": {
"description": "Barı ekranda nereye yerleştireceğinizi seçin.",
"label": "Bar konumu"
@@ -741,10 +745,6 @@
"show-capsule": {
"description": "Widget arka planlarını göster.",
"label": "Kapsülü göster"
},
"outer-corners": {
"description": "Çubuğun dışa doğru kavisli köşelerini görüntüler.",
"label": "Dış köşeler"
}
},
"monitors": {
@@ -857,6 +857,10 @@
"label": "Şablonlar"
},
"terminal": {
"alacritty": {
"description": "{filepath} yaz ve yeniden yükle",
"description-missing": "{app} uygulamasının yüklü olmasını gerektirir"
},
"description": "Terminal emülatörü temalandırma.",
"foot": {
"description": "{filepath} dosyasına yaz ve yeniden yükle",
@@ -871,10 +875,6 @@
"description-missing": "Kurulum için {app} gereklidir"
},
"label": "Terminal",
"alacritty": {
"description": "{filepath} yaz ve yeniden yükle",
"description-missing": "{app} uygulamasının yüklü olmasını gerektirir"
},
"wezterm": {
"description": "{filepath} yaz ve yeniden yükle",
"description-missing": "{app} uygulamasının yüklü olmasını gerektirir"
@@ -912,12 +912,6 @@
"label": "Görünüm"
},
"shortcuts": {
"section": {
"description": "Kısayut widget'larını yapılandırın ve yönetin.",
"label": "Kısayut widget'ları"
},
"sectionLeft": "Sol",
"sectionRight": "Sağ",
"custom-button": {
"browse": "Göz at",
"command": {
@@ -971,7 +965,13 @@
"dialog": {
"apply": "Uygula",
"cancel": "İptal"
}
},
"section": {
"description": "Kısayut widget'larını yapılandırın ve yönetin.",
"label": "Kısayut widget'ları"
},
"sectionLeft": "Sol",
"sectionRight": "Sağ"
},
"title": "Kontrol Merkezi"
},
@@ -982,21 +982,21 @@
"description": "Parlaklık değişimleri için adım boyutunu ayarlayın (tekerlek ve klavye kısayolları).",
"label": "Parlaklık adım boyutu"
},
"enforce-minimum": {
"description": "Bazı ekranlarda %0 parlaklıkta arka ışığın tamamen kapanması sorununu çözer.",
"label": "Minimum parlaklığı zorla (%1)"
},
"section": {
"description": "Her ekran için parlaklık ayarlarını yapın.",
"label": "Ekran başına ayarlar"
},
"brightness-unavailable": {
"ddc-disabled": "Parlaklık kontrolü kullanılamıyor. Bu ekranın parlaklığını kontrol etmek için \"Harici parlaklık desteği\"ni etkinleştirin.",
"generic": "Bu ekran için parlaklık kontrolü mevcut değil."
},
"enforce-minimum": {
"description": "Bazı ekranlarda %0 parlaklıkta arka ışığın tamamen kapanması sorununu çözer.",
"label": "Minimum parlaklığı zorla (%1)"
},
"external-brightness": {
"description": "Harici ekranlarda parlaklığı DDC/CI protokolü üzerinden kontrol etmek için DDCUtil desteğini etkinleştir.",
"label": "Harici parlaklık desteği"
},
"section": {
"description": "Her ekran için parlaklık ayarlarını yapın.",
"label": "Ekran başına ayarlar"
}
},
"night-light": {
@@ -1476,13 +1476,17 @@
"label": "Kenar yarıçapı",
"reset": "Kenar yarıçapını sıfırla"
},
"dim-desktop": {
"description": "Paneller veya menüler açıkken masaüstünü karart.",
"label": "Masaüstünü karart"
},
"panels-attached-to-bar": {
"description": "Etkinleştirildiğinde, paneller harika ters köşe tasarımıyla çubuğa eklenecektir",
"label": "Panelleri çubuğa bağla"
"description": "Paneller çubuğa ve ekran kenarlarına kilitlenerek şık ters köşelerle kusursuz bir görünüm oluşturur.",
"label": "Kenarları Yakala"
},
"panels-overlay": {
"description": "Paneller tam ekran pencerelerin üzerinde görünecektir",
"label": "Panelleri katman olarak aç"
"description": "Panellerin ve çubuğun, tam ekran uygulamalarda bile görünür kalmasını sağlar.",
"label": "Panelleri ve Çubuğu Üstte Tut"
},
"scaling": {
"description": "Çubuğu hariç tutarak genel kullanıcı arayüzünün boyutunu değiştirir.",
@@ -1493,18 +1497,14 @@
"description": "Arayüzün görünümünü, hissini ve davranışını özelleştirin.",
"label": "Görünüm"
},
"shadows": {
"description": "Çubukların ve panellerin altında gölgelerin etkinleştirilmesini sağlar.",
"label": "Gölge efektleri"
},
"title": "Kullanıcı arayüzü",
"tooltips": {
"description": "Arayüz genelindeki ipuçlarını etkinleştirin veya devre dışı bırakın.",
"label": "İpuçlarını göster"
},
"dim-desktop": {
"description": "Paneller veya menüler açıkken masaüstünü karart.",
"label": "Masaüstünü karart"
},
"shadows": {
"description": "Çubukların ve panellerin altında gölgelerin etkinleştirilmesini sağlar.",
"label": "Gölge efektleri"
}
},
"wallpaper": {
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+56 -12
View File
@@ -272,10 +272,10 @@ extract_empty_keys() {
# Function to remove empty objects recursively from JSON file
remove_empty_objects() {
local json_file=$1
# Create a temporary file
local temp_file=$(mktemp)
# Use jq to recursively remove empty objects
# This function walks the entire JSON tree and removes any object that contains no leaf values
jq '
@@ -303,7 +303,26 @@ remove_empty_objects() {
end;
remove_empty
' "$json_file" > "$temp_file" 2>/dev/null
if [[ $? -eq 0 ]]; then
mv "$temp_file" "$json_file"
return 0
else
rm -f "$temp_file"
return 1
fi
}
# Function to sort JSON keys alphabetically (recursively)
sort_json_keys() {
local json_file=$1
# Create a temporary file
local temp_file=$(mktemp)
# Use jq to recursively sort all object keys
jq --sort-keys '.' "$json_file" > "$temp_file" 2>/dev/null
if [[ $? -eq 0 ]]; then
mv "$temp_file" "$json_file"
return 0
@@ -329,7 +348,7 @@ generate_header() {
echo "Reference file: $REFERENCE_FILE"
echo "Folder: $(realpath "$FOLDER_PATH")"
if $TRANSLATE_MODE; then
echo "Mode: TRANSLATION ENABLED (translates missing keys, removes extra/empty keys and empty objects)"
echo "Mode: TRANSLATION ENABLED (translates missing keys, removes extra/empty keys and empty objects, sorts all keys alphabetically)"
fi
echo ""
echo "Notes:"
@@ -342,6 +361,7 @@ generate_header() {
echo "- Results are sorted by descending line numbers for easier editing"
if $TRANSLATE_MODE; then
echo "- In translation mode, extra keys, empty keys, and empty objects are automatically removed"
echo "- In translation mode, all keys are sorted alphabetically to ensure consistency across languages"
fi
echo ""
echo "This report compares all language JSON files against the English reference file"
@@ -622,8 +642,18 @@ compare_language() {
print_color $RED "✗ Failed to clean up empty objects" >&2
echo ""
fi
# Sort all keys alphabetically to maintain consistency across language files
print_color $BLUE "Sorting keys alphabetically in $lang_name..." >&2
if sort_json_keys "$lang_file"; then
print_color $GREEN "✓ Keys sorted alphabetically" >&2
echo ""
else
print_color $RED "✗ Failed to sort keys" >&2
echo ""
fi
fi
# Clean up
rm -f "$lang_keys_file"
}
@@ -699,12 +729,24 @@ main() {
# Generate report header
generate_header
# Sort the English reference file if in translate mode
if $TRANSLATE_MODE; then
print_color $BLUE "Sorting keys alphabetically in English reference file..." >&2
if sort_json_keys "$ref_file_path"; then
print_color $GREEN "✓ English reference file keys sorted alphabetically" >&2
echo "" >&2
else
print_color $RED "✗ Failed to sort English reference file keys" >&2
echo "" >&2
fi
fi
local processed=0
for lang_file in "${language_files[@]}"; do
local filename=$(basename "$lang_file")
local lang_name="${filename%.json}"
# Skip the reference file in all-languages mode
if [[ -z "$target_language" && "$filename" == "$REFERENCE_FILE" ]]; then
continue
@@ -737,7 +779,7 @@ main() {
echo "Target language: $target_language"
fi
if $TRANSLATE_MODE; then
echo "Translation mode: ENABLED (translated missing keys, removed extra keys, removed empty keys and objects)"
echo "Translation mode: ENABLED (translated missing keys, removed extra keys, removed empty keys and objects, sorted keys alphabetically)"
fi
echo "Report generated: $(date '+%Y-%m-%d %H:%M:%S')"
echo ""
@@ -761,8 +803,9 @@ show_usage() {
echo "" >&2
echo "Arguments:" >&2
echo " --translate Enable automatic translation of missing keys, removal of extra keys," >&2
echo " removal of empty keys (empty strings or null values), and removal of" >&2
echo " empty objects (nested objects containing no actual values)" >&2
echo " removal of empty keys (empty strings or null values), removal of" >&2
echo " empty objects (nested objects containing no actual values), and" >&2
echo " alphabetical sorting of all keys for consistency" >&2
echo " --list-models List all available Gemini models and exit" >&2
echo " language_code Optional. Compare only the specified language (e.g., 'fr', 'es', 'de')" >&2
echo " If not provided, all language files will be compared" >&2
@@ -775,8 +818,8 @@ show_usage() {
echo " $0 # Compare all languages" >&2
echo " $0 fr # Compare only French (fr.json)" >&2
echo " $0 --list-models # List available Gemini models" >&2
echo " $0 --translate # Compare all, translate missing, remove extra/empty keys and objects" >&2
echo " $0 --translate fr # Translate and clean French only" >&2
echo " $0 --translate # Compare all, translate missing, remove extra/empty keys and objects, sort keys" >&2
echo " $0 --translate fr # Translate, clean, and sort French only" >&2
echo "" >&2
echo "Requirements:" >&2
echo " - jq must be installed" >&2
@@ -790,6 +833,7 @@ show_usage() {
echo " - Progress messages are printed to stderr" >&2
echo " - Results are sorted by descending line numbers for easier editing" >&2
echo " - In translate mode, extra keys, empty keys, and empty objects are removed" >&2
echo " - In translate mode, all keys are sorted alphabetically for consistency" >&2
}
# Handle command line arguments
-31
View File
@@ -1,31 +0,0 @@
#!/usr/bin/env -S bash
# Comprehensive i18n checker for QML files
# Finds hardcoded strings in various QML properties
find . -name "*.qml" -type f | while read -r file; do
# Skip if file doesn't exist or is not readable
[[ ! -r "$file" ]] && continue
# Check for hardcoded strings in common properties
# Matches: property: "text with letters" but excludes I18n.tr calls
issues=$(grep -n -E '(label|text|title|description|placeholder|tooltipText|tooltip):\s*"[^"]*[a-zA-Z][^"]*"' "$file" | grep -v 'I18n\.tr')
# Also check for template literals with hardcoded text
template_issues=$(grep -n -E '(label|text|title|description|placeholder|tooltipText|tooltip):\s*`[^`]*[a-zA-Z][^`]*`' "$file" | grep -v 'I18n\.tr')
# Check for property assignments with hardcoded strings
property_issues=$(grep -n -E 'property\s+string\s+\w+:\s*"[^"]*[a-zA-Z][^"]*"' "$file" | grep -v 'I18n\.tr')
# Check for JavaScript object properties with hardcoded strings (like in arrays/models)
js_object_issues=$(grep -n -E '"(label|text|title|description|placeholder|name)":\s*"[^"]*[a-zA-Z][^"]*"' "$file" | grep -v 'I18n\.tr')
if [[ -n "$issues" || -n "$template_issues" || -n "$property_issues" || -n "$js_object_issues" ]]; then
echo "$file"
[[ -n "$issues" ]] && echo "$issues"
[[ -n "$template_issues" ]] && echo "$template_issues"
[[ -n "$property_issues" ]] && echo "$property_issues"
[[ -n "$js_object_issues" ]] && echo "$js_object_issues"
echo
fi
done