Skip to content

Commit

Permalink
Translation keys etc: Address feedback from TotalCaesar659
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jan 23, 2024
1 parent acd43ad commit 21d5257
Show file tree
Hide file tree
Showing 47 changed files with 140 additions and 48 deletions.
3 changes: 1 addition & 2 deletions Common/Data/Text/I18n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ const char *I18NCategory::T(const char *key, const char *def) {
return "ERROR";
}

// Replace the \n's with \\n's so that key values with newlines will be found correctly.
auto iter = map_.find(key);
if (iter != map_.end()) {
return iter->second.text.c_str();
Expand All @@ -94,7 +93,7 @@ const char *I18NCategory::T(const char *key, const char *def) {
void I18NCategory::SetMap(const std::map<std::string, std::string> &m) {
for (auto iter = m.begin(); iter != m.end(); ++iter) {
if (map_.find(iter->first) == map_.end()) {
std::string text = ReplaceAll(iter->second, "\n", "\\n");
std::string text = ReplaceAll(iter->second, "\\n", "\n");
_dbg_assert_(iter->first.find('\n') == std::string::npos);
map_[iter->first] = I18NEntry(text);
}
Expand Down
36 changes: 36 additions & 0 deletions Tools/langtool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ enum Command {
new: String,
key: String,
},
CopyKey {
old: String,
new: String,
key: String,
},
RenameKey {
section: String,
old: String,
Expand Down Expand Up @@ -112,6 +117,23 @@ fn move_key(target_ini: &mut IniFile, old: &str, new: &str, key: &str) -> io::Re
Ok(())
}

fn copy_key(target_ini: &mut IniFile, old: &str, new: &str, key: &str) -> io::Result<()> {
if let Some(old_section) = target_ini.get_section_mut(old) {
if let Some(line) = old_section.get_line(key) {
if let Some(new_section) = target_ini.get_section_mut(new) {
new_section.insert_line_if_missing(&line);
} else {
println!("No new section {}", new);
}
} else {
println!("No key {} in section {}", key, old);
}
} else {
println!("No old section {}", old);
}
Ok(())
}

fn remove_key(target_ini: &mut IniFile, section: &str, key: &str) -> io::Result<()> {
if let Some(old_section) = target_ini.get_section_mut(section) {
old_section.remove_line(key);
Expand Down Expand Up @@ -224,6 +246,13 @@ fn main() {
} => {
move_key(&mut target_ini, old, new, key).unwrap();
}
Command::CopyKey {
ref old,
ref new,
ref key,
} => {
copy_key(&mut target_ini, old, new, key).unwrap();
}
Command::RemoveKey {
ref section,
ref key,
Expand Down Expand Up @@ -272,6 +301,13 @@ fn main() {
} => {
move_key(&mut reference_ini, old, new, key).unwrap();
}
Command::CopyKey {
ref old,
ref new,
ref key,
} => {
copy_key(&mut reference_ini, old, new, key).unwrap();
}
Command::RemoveKey {
ref section,
ref key,
Expand Down
15 changes: 15 additions & 0 deletions Tools/langtool/src/section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ impl Section {
}
}

pub fn get_line(&mut self, key: &str) -> Option<String> {
for line in self.lines.iter() {
let prefix = if let Some(pos) = line.find(" =") {
&line[0..pos]
} else {
continue;
};

if prefix.eq_ignore_ascii_case(key) {
return Some(line.clone());
}
}
None
}

pub fn insert_line_if_missing(&mut self, line: &str) -> bool {
let prefix = if let Some(pos) = line.find(" =") {
&line[0..pos + 2]
Expand Down
2 changes: 1 addition & 1 deletion UI/GameSettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) {
static const char *buttonPref[] = { "Use O to confirm", "Use X to confirm" };
systemSettings->Add(new PopupMultiChoice(&g_Config.iButtonPreference, sy->T("Confirmation Button"), buttonPref, 0, 2, I18NCat::SYSTEM, screenManager()));

systemSettings->Add(new ItemHeader(sy->T("Recording settings")));
systemSettings->Add(new ItemHeader(sy->T("Recording")));
#if defined(_WIN32) || (defined(USING_QT_UI) && !defined(MOBILE_DEVICE))
systemSettings->Add(new CheckBox(&g_Config.bDumpFrames, sy->T("Record Display")));
systemSettings->Add(new CheckBox(&g_Config.bUseFFV1, sy->T("Use Lossless Video Codec (FFV1)")));
Expand Down
3 changes: 2 additions & 1 deletion assets/lang/ar_AE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ Dump next frame to log = Dump next frame to log
Enable driver bug workarounds = Enable driver bug workarounds
Enable Logging = ‎تفعيل سجل التصحيح
Enter address = ‎أدخل العنوان
Fast-forward mode = Fast-forward mode
FPU = FPU
Fragment = Fragment
Frame timing = Frame timing
Expand Down Expand Up @@ -629,7 +630,6 @@ Hybrid = ‎هجين
Hybrid + Bicubic = ‎هجين + تكعيب
Ignore camera notch when centering = Ignore camera notch when centering
Install custom driver... = Install custom driver...
Install Custom Driver... = Install Custom Driver...
Integer scale factor = Integer scale factor
Internal Resolution = Internal resolution
Lazy texture caching = Lazy texture caching (speedup)
Expand Down Expand Up @@ -1325,6 +1325,7 @@ PSP-2000/3000 = PSP-2000/3000
Recent games = Recent games
Record Audio = ‎تسجيل الصوت
Record Display = ‎سجل الفيديو
Recording = Recording
Reset Recording on Save/Load State = Reset recording on Save/Load state
Restore Default Settings = ‎إلي الإفتراضي PPSSPP's إعادة إعدادات
RetroAchievements = RetroAchievements
Expand Down
3 changes: 2 additions & 1 deletion assets/lang/az_AZ.ini
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ Dump next frame to log = Dump next frame to log
Enable driver bug workarounds = Enable driver bug workarounds
Enable Logging = Enable debug logging
Enter address = Enter address
Fast-forward mode = Fast-forward mode
FPU = FPU
Fragment = Fragment
Frame timing = Frame timing
Expand Down Expand Up @@ -621,7 +622,6 @@ Hybrid = Hybrid
Hybrid + Bicubic = Hybrid + Bicubic
Ignore camera notch when centering = Ignore camera notch when centering
Install custom driver... = Install custom driver...
Install Custom Driver... = Install Custom Driver...
Integer scale factor = Integer scale factor
Internal Resolution = Internal resolution
Lazy texture caching = Lazy texture caching (speedup)
Expand Down Expand Up @@ -1317,6 +1317,7 @@ PSP-2000/3000 = PSP-2000/3000
Recent games = Recent games
Record Audio = Record audio
Record Display = Record display
Recording = Recording
Reset Recording on Save/Load State = Reset recording on Save/Load state
Restore Default Settings = Restore PPSSPP's settings to default
RetroAchievements = RetroAchievements
Expand Down
3 changes: 2 additions & 1 deletion assets/lang/bg_BG.ini
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ Dump next frame to log = Dump next frame to log
Enable driver bug workarounds = Enable driver bug workarounds
Enable Logging = Enable debug logging
Enter address = Enter address
Fast-forward mode = Fast-forward mode
FPU = FPU
Fragment = Fragment
Frame timing = Frame timing
Expand Down Expand Up @@ -621,7 +622,6 @@ Hybrid = Hybrid
Hybrid + Bicubic = Hybrid + Bicubic
Ignore camera notch when centering = Ignore camera notch when centering
Install custom driver... = Install custom driver...
Install Custom Driver... = Install Custom Driver...
Integer scale factor = Integer scale factor
Internal Resolution = Вътрешна резолюция
Lazy texture caching = Мързеливо текстурно кеширане (ускорява)
Expand Down Expand Up @@ -1317,6 +1317,7 @@ PSP-2000/3000 = PSP-2000/3000
Recent games = Recent games
Record Audio = Record audio
Record Display = Record display
Recording = Recording
Reset Recording on Save/Load State = Reset recording on Save/Load state
Restore Default Settings = Възстанови първоначалните настройки на PPSSPP
RetroAchievements = RetroAchievements
Expand Down
3 changes: 2 additions & 1 deletion assets/lang/ca_ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ Dump next frame to log = Dump next frame to log
Enable driver bug workarounds = Enable driver bug workarounds
Enable Logging = Activa el registre
Enter address = Inseriu adreça
Fast-forward mode = Fast-forward mode
FPU = FPU
Fragment = Fragment
Frame timing = Frame timing
Expand Down Expand Up @@ -621,7 +622,6 @@ Hybrid = Híbrid
Hybrid + Bicubic = Híbrid i bicúbic
Ignore camera notch when centering = Ignora la notch de la càmera usant el centre d'imatge.
Install custom driver... = Install custom driver...
Install Custom Driver... = Install Custom Driver...
Integer scale factor = Integer scale factor
Internal Resolution = Resolució interna
Lazy texture caching = Memòria cau de textures diferit (ràpid)
Expand Down Expand Up @@ -1317,6 +1317,7 @@ PSP-2000/3000 = PSP-2000/3000
Recent games = Recent games
Record Audio = Record audio
Record Display = Record display
Recording = Recording
Reset Recording on Save/Load State = Reset recording on Save/Load state
Restore Default Settings = Restore PPSSPP's settings to default
RetroAchievements = RetroAchievements
Expand Down
3 changes: 2 additions & 1 deletion assets/lang/cz_CZ.ini
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ Dump next frame to log = Vypsat příští snímek do záznamu
Enable driver bug workarounds = Enable driver bug workarounds
Enable Logging = Povolit záznam při ladění
Enter address = Zadejte adresu
Fast-forward mode = Rychle vpřed
FPU = FPU
Fragment = Fragment
Frame timing = Frame timing
Expand Down Expand Up @@ -621,7 +622,6 @@ Hybrid = Hybridní
Hybrid + Bicubic = Hybridní + Bikubická
Ignore camera notch when centering = Ignore camera notch when centering
Install custom driver... = Install custom driver...
Install Custom Driver... = Install Custom Driver...
Integer scale factor = Integer scale factor
Internal Resolution = Vnitřní rozlišení
Lazy texture caching = Líné ukládání textur do mezipaměti (zrychlení)
Expand Down Expand Up @@ -1317,6 +1317,7 @@ PSP-2000/3000 = PSP-2000/3000
Recent games = Recent games
Record Audio = Record audio
Record Display = Record display
Recording = Recording
Reset Recording on Save/Load State = Reset recording on Save/Load state
Restore Default Settings = Obnovit výchozí nastavení PPSSPP
RetroAchievements = RetroAchievements
Expand Down
3 changes: 2 additions & 1 deletion assets/lang/da_DK.ini
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ Dump next frame to log = Gem næste frame i loggen
Enable driver bug workarounds = Enable driver bug workarounds
Enable Logging = Aktiver fejlfindingslogning
Enter address = Indtast adresse
Fast-forward mode = Turbo
FPU = FPU
Fragment = Fragment
Frame timing = Frame timing
Expand Down Expand Up @@ -621,7 +622,6 @@ Hybrid = Hybrid
Hybrid + Bicubic = Hybrid + Bicubisk
Ignore camera notch when centering = Ignore camera notch when centering
Install custom driver... = Install custom driver...
Install Custom Driver... = Install Custom Driver...
Integer scale factor = Integer scale factor
Internal Resolution = Intern opløsning
Lazy texture caching = Træg textur caching (hurtigere)
Expand Down Expand Up @@ -1317,6 +1317,7 @@ PSP-2000/3000 = PSP-2000/3000
Recent games = Recent games
Record Audio = Optag lyd
Record Display = Optag skærm
Recording = Recording
Reset Recording on Save/Load State = Reset recording on Save/Load state
Restore Default Settings = Sæt PPSSPP's indstillinger tilbage til standard
RetroAchievements = RetroAchievements
Expand Down
3 changes: 2 additions & 1 deletion assets/lang/de_DE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ Dump next frame to log = Nächsten Frame im Log speichern
Enable driver bug workarounds = Aktiviere Driver-Fehler workarounds
Enable Logging = Aktiviere Logging
Enter address = Adresse eingeben
Fast-forward mode = Turbo
FPU = FPU
Fragment = Fragment
Frame timing = Frame timing
Expand Down Expand Up @@ -621,7 +622,6 @@ Hybrid = Hybrid
Hybrid + Bicubic = Hybrid + Bikubisch
Ignore camera notch when centering = Ignore camera notch when centering
Install custom driver... = Install custom driver...
Install Custom Driver... = Install Custom Driver...
Integer scale factor = Integer scale factor
Internal Resolution = Interne Auflösung
Lazy texture caching = Träges Textur-Caching (schneller)
Expand Down Expand Up @@ -1317,6 +1317,7 @@ PSP-2000/3000 = PSP-2000/3000
Recent games = Recent games
Record Audio = Ton aufzeichnen
Record Display = Bildschirm aufzeichnen
Recording = Recording
Reset Recording on Save/Load State = Zurücksetzen der Aufnahme bei Laden/Speichern eines Standes
Restore Default Settings = Auf Standardeinstellungen zurücksetzen
RetroAchievements = RetroAchievements
Expand Down
3 changes: 2 additions & 1 deletion assets/lang/dr_ID.ini
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ Dump next frame to log = Palakoi log to gambara' undipa
Enable driver bug workarounds = Enable driver bug workarounds
Enable Logging = Padenni Log
Enter address = Enter address
Fast-forward mode = Fast-forward mode
FPU = FPU
Fragment = Fragment
Frame timing = Frame timing
Expand Down Expand Up @@ -621,7 +622,6 @@ Hybrid = Hybrid
Hybrid + Bicubic = Hybrid + Bicubic
Ignore camera notch when centering = Ignore camera notch when centering
Install custom driver... = Install custom driver...
Install Custom Driver... = Install Custom Driver...
Integer scale factor = Integer scale factor
Internal Resolution = Internal resolution
Lazy texture caching = Lazy texture caching (speedup)
Expand Down Expand Up @@ -1317,6 +1317,7 @@ PSP-2000/3000 = PSP-2000/3000
Recent games = Recent games
Record Audio = Record audio
Record Display = Record display
Recording = Recording
Reset Recording on Save/Load State = Reset recording on Save/Load state
Restore Default Settings = Restore PPSSPP's settings to default
RetroAchievements = RetroAchievements
Expand Down
3 changes: 2 additions & 1 deletion assets/lang/en_US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ Dump next frame to log = Dump next frame to log
Enable driver bug workarounds = Enable driver bug workarounds
Enable Logging = Enable debug logging
Enter address = Enter address
Fast-forward mode = Fast-forward mode
Fragment = Fragment
FPU = FPU
Framedump tests = Framedump tests
Expand Down Expand Up @@ -645,7 +646,6 @@ Hybrid = Hybrid
Hybrid + Bicubic = Hybrid + Bicubic
Ignore camera notch when centering = Ignore camera notch when centering
Install custom driver... = Install custom driver...
Install Custom Driver... = Install Custom Driver...
Integer scale factor = Integer scale factor
Internal Resolution = Internal resolution
Lazy texture caching = Lazy texture caching (speedup)
Expand Down Expand Up @@ -1331,6 +1331,7 @@ PSP-2000/3000 = PSP-2000/3000
Recent games = Recent games
Record Audio = Record audio
Record Display = Record display
Recording = Recording
Reset Recording on Save/Load State = Reset recording on Save/Load state
Restore Default Settings = Restore PPSSPP's settings to default
RetroAchievements = RetroAchievements
Expand Down
3 changes: 2 additions & 1 deletion assets/lang/es_ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ Dump next frame to log = Volcar siguiente cuadro al registro
Enable driver bug workarounds = Activar arreglos alternativos para fallos de drivers
Enable Logging = Activar registro
Enter address = Insertar dirección
Fast-forward mode = Modo turbo
FPU = FPU
Fragment = Fragment
Frame Profiler = Medir rendimiento
Expand Down Expand Up @@ -621,7 +622,6 @@ Hybrid = Híbrido
Hybrid + Bicubic = Híbrido y bicúbico
Ignore camera notch when centering = Ignorar notch de la cámara usando centrado de imagen.
Install custom driver... = Install custom driver...
Install Custom Driver... = Install Custom Driver...
Integer scale factor = Factor de escala entero
Internal Resolution = Resolución interna
Lazy texture caching = Caché de texturas diferido (rápido)
Expand Down Expand Up @@ -1318,6 +1318,7 @@ PSP-2000/3000 = PSP-2000/3000
Recent games = Juegos recientes
Record Audio = Grabar audio
Record Display = Grabar pantalla
Recording = Recording
Reset Recording on Save/Load State = Reiniciar grabación al cargar/guardar estado
Restore Default Settings = Reestablecer ajustes
RetroAchievements = RetroAchievements
Expand Down
3 changes: 2 additions & 1 deletion assets/lang/es_LA.ini
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ Dump next frame to log = Volcar siguiente cuadro al registro
Enable driver bug workarounds = Activar arreglos alternativos para fallos de drivers
Enable Logging = Activar registro
Enter address = Insertar dirección
Fast-forward mode = Modo turbo
FPU = FPU
Fragment = Fragment
Frame timing = Frame timing
Expand Down Expand Up @@ -621,7 +622,6 @@ Hybrid = Híbrido
Hybrid + Bicubic = Híbrido + bicúbico
Ignore camera notch when centering = Ignorar muesca de la cámara al centrar
Install custom driver... = Install custom driver...
Install Custom Driver... = Install Custom Driver...
Integer scale factor = Integer scale factor
Internal Resolution = Resolución interna
Lazy texture caching = Caché de texturas diferido (rápido)
Expand Down Expand Up @@ -1319,6 +1319,7 @@ PSP-2000/3000 = PSP-2000/3000
Recent games = Juegos recientes
Record Audio = Grabar Audio
Record Display = Grabar pantalla
Recording = Recording
Reset Recording on Save/Load State = Reiniciar grabación al abrir/guardar estados
Restore Default Settings = Reestablecer ajustes
RetroAchievements = RetroAchievements
Expand Down
3 changes: 2 additions & 1 deletion assets/lang/fa_IR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ Dump next frame to log = ‎ریختن فریم بعدی به فایل لاگ
Enable driver bug workarounds = Enable driver bug workarounds
Enable Logging = ‎روشن کردن لاگ باگ ها
Enter address = وارد کردن ادرس
Fast-forward mode = Fast-forward mode
FPU = FPU
Fragment = Fragment
Frame timing = Frame timing
Expand Down Expand Up @@ -621,7 +622,6 @@ Hybrid = ‎Hybrid (ترکیبی)
Hybrid + Bicubic = Hybrid + Bicubic
Ignore camera notch when centering = Ignore camera notch when centering
Install custom driver... = Install custom driver...
Install Custom Driver... = Install Custom Driver...
Integer scale factor = Integer scale factor
Internal Resolution = ‎رزولوشن داخلی
Lazy texture caching = ‎کش کردن تکسچر های ماندگار (افزایش سرعت)
Expand Down Expand Up @@ -1317,6 +1317,7 @@ PSP-2000/3000 = PSP-2000/3000
Recent games = Recent games
Record Audio = ‎ضبط صدا
Record Display = ‎ضبط صفحه
Recording = Recording
Reset Recording on Save/Load State = Reset recording on Save/Load state
Restore Default Settings = ‎به حالت اولیه PPSSPP بازگشت تنظیمات
RetroAchievements = RetroAchievements
Expand Down
Loading

0 comments on commit 21d5257

Please sign in to comment.