Add RTL language property

This doesn't have an effect yet, but it'll do things like
right-alignment in textboxes and other design-flipping.
This commit is contained in:
Dav999 2024-01-03 19:07:28 +01:00 committed by Misa Elizabeth Kai
parent 2003eed2a5
commit 37c4f76988
24 changed files with 69 additions and 0 deletions

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>1</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -27,6 +27,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -26,6 +26,9 @@
<!-- When automatically uppercasing, allow ~ to be used to stop the next letter from being uppercased (for Irish) -->
<toupper_lower_escape_char>0</toupper_lower_escape_char>
<!-- Enable for RTL languages like Arabic or Hebrew -->
<rtl>0</rtl>
<!-- The indication that a certain menu option or button is selected -->
<menu_select>[ {label} ]</menu_select>
<menu_select_tight>[{label}]</menu_select_tight>

View File

@ -27,6 +27,7 @@ struct LangMeta
bool toupper; // = true; enable automatic full-caps for menu options
bool toupper_i_dot; // = false; enable Turkish i mapping when uppercasing
bool toupper_lower_escape_char; // = false; enable ~ to mark lowercase letters for uppercasing
bool rtl; // = false; enable for RTL languages like Arabic or Hebrew
std::string menu_select;
std::string menu_select_tight;
uint8_t font_idx;

View File

@ -96,6 +96,8 @@ static void sync_lang_file(const std::string& langcode)
pElem->SetText((int) langmeta.toupper_i_dot);
else if (SDL_strcmp(pKey, "toupper_lower_escape_char") == 0)
pElem->SetText((int) langmeta.toupper_lower_escape_char);
else if (SDL_strcmp(pKey, "rtl") == 0)
pElem->SetText((int) langmeta.rtl);
else if (SDL_strcmp(pKey, "menu_select") == 0)
pElem->SetText(langmeta.menu_select.c_str());
else if (SDL_strcmp(pKey, "menu_select_tight") == 0)

View File

@ -67,6 +67,7 @@ static void loadmeta(LangMeta& meta, const std::string& langcode = lang)
meta.toupper = true;
meta.toupper_i_dot = false;
meta.toupper_lower_escape_char = false;
meta.rtl = false;
meta.menu_select = "[ {label} ]";
meta.menu_select_tight = "[{label}]";
meta.font_idx = font::get_font_idx_8x8();
@ -107,6 +108,8 @@ static void loadmeta(LangMeta& meta, const std::string& langcode = lang)
meta.toupper_i_dot = help.Int(pText);
else if (SDL_strcmp(pKey, "toupper_lower_escape_char") == 0)
meta.toupper_lower_escape_char = help.Int(pText);
else if (SDL_strcmp(pKey, "rtl") == 0)
meta.rtl = help.Int(pText);
else if (SDL_strcmp(pKey, "menu_select") == 0)
meta.menu_select = std::string(pText);
else if (SDL_strcmp(pKey, "menu_select_tight") == 0)