Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit c2033ff

Browse files
qol
1 parent 170d574 commit c2033ff

File tree

5 files changed

+26
-1
lines changed

5 files changed

+26
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ localization/xmnjvfk.py
2020
localization/localization_ja.csv
2121
localization/localization_ja_missing.csv
2222
localization/localization_bak2.csv
23+
localization/.~lock.localization.csv#

OFS-lib/localization/OFS_Localization.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ OFS_Translator* OFS_Translator::ptr = nullptr;
66

77
OFS_Translator::OFS_Translator() noexcept
88
{
9+
Util::CreateDirectories(Util::Prefpath(TranslationDir));
910
// initialize with the default strings
1011
LoadDefaults();
1112
}

localization/localization.csv

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,4 +501,6 @@ SPECIAL_FUNCTIONS,Special functions,Special functions
501501
MEMORY_USAGE,Memory usage,Memory usage
502502
UPDATE,Update,Update
503503
SLOWEST,slowest,slowest
504-
LANGUAGE,Language,Language
504+
LANGUAGE,Language,Language
505+
ACTION_RELOAD_TRANSLATION,Reload current translation,Reload current translation
506+
DIRECTORY,Directory,Directory

src/OpenFunscripter.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,22 @@ void OpenFunscripter::registerBindings()
551551
0
552552
);
553553

554+
auto& reload_translation = group.bindings.emplace_back(
555+
"reload_translation_csv",
556+
Tr::ACTION_RELOAD_TRANSLATION,
557+
true,
558+
[&](void*)
559+
{
560+
if(!settings->data().language_csv.empty())
561+
{
562+
if(OFS_Translator::ptr->LoadTranslation(settings->data().language_csv.c_str()))
563+
{
564+
OFS_DynFontAtlas::AddTranslationText();
565+
}
566+
}
567+
}
568+
);
569+
554570
keybinds.registerBinding(std::move(group));
555571
}
556572
{

src/UI/OFS_Settings.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ bool OFS_Settings::ShowPreferenceWindow() noexcept
152152
data().language_csv = std::string();
153153
OFS_Translator::ptr->LoadDefaults();
154154
}
155+
ImGui::SameLine();
156+
if(ImGui::Button(TR_ID("OPEN_DIR_LANG", Tr::DIRECTORY)))
157+
{
158+
Util::OpenFileExplorer(Util::Prefpath(OFS_Translator::TranslationDir));
159+
}
155160
ImGui::EndTabItem();
156161
}
157162
if (ImGui::BeginTabItem(TR(VIDEOPLAYER))) {

0 commit comments

Comments
 (0)