From e3fff57fed133bbef9fd739e8b180329f929f5dc Mon Sep 17 00:00:00 2001 From: Zachary Hall Date: Tue, 25 Jul 2023 14:33:29 -0700 Subject: [PATCH] Update translations and improve support --- .../ja_JP/LC_MESSAGES/neko_player.mo | Bin 0 -> 10726 bytes .../ja_JP/LC_MESSAGES/neko_player.po | 585 ++++++++++++++++++ .../neko_player.pot} | 308 ++++----- install.sh | 3 - main.cpp | 80 ++- meson.build | 3 +- theme.cpp | 126 ++-- translation.h | 13 +- 8 files changed, 875 insertions(+), 243 deletions(-) create mode 100644 assets/translations/ja_JP/LC_MESSAGES/neko_player.mo create mode 100644 assets/translations/ja_JP/LC_MESSAGES/neko_player.po rename assets/{translation/messages.pot => translations/neko_player.pot} (57%) delete mode 100755 install.sh diff --git a/assets/translations/ja_JP/LC_MESSAGES/neko_player.mo b/assets/translations/ja_JP/LC_MESSAGES/neko_player.mo new file mode 100644 index 0000000000000000000000000000000000000000..ed9691b65d0291b7ea80e5111f8f3f52c0e65d68 GIT binary patch literal 10726 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 TApCgB@551C7U1D(zI*=%8me6m literal 0 HcmV?d00001 diff --git a/assets/translations/ja_JP/LC_MESSAGES/neko_player.po b/assets/translations/ja_JP/LC_MESSAGES/neko_player.po new file mode 100644 index 0000000..df55bfc --- /dev/null +++ b/assets/translations/ja_JP/LC_MESSAGES/neko_player.po @@ -0,0 +1,585 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# ,fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Neko Player\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-07-25 14:02-0700\n" +"PO-Revision-Date: 2023-07-25 14:22-0700\n" +"Last-Translator: \n" +"Language-Team: None\n" +"Language: ja_JP\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.3.2\n" +"X-Poedit-KeywordsList: _TR;_TRS;_TRIS:2;_TRI:2;_TR_CTX:1c,2;_TRS_CTX:1c,2;" +"_TRIS_CTX:2c,3;_TRI_CTX:2c,3\n" +"X-Poedit-Basepath: ../..\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-SearchPath-0: theme.cpp\n" +"X-Poedit-SearchPath-1: main.cpp\n" + +#: main.cpp:120 +msgctxt "Language name" +msgid "English (United States)" +msgstr "Japanese (Japan)" + +#: main.cpp:292 +msgctxt "Built-in themes | Theme default strings | name" +msgid "(built-in)" +msgstr "(内蔵)" + +#: main.cpp:296 +msgctxt "Built-in light theme | Theme default strings | name" +msgid "Default light" +msgstr "デフォルトのライト" + +#: main.cpp:304 +msgctxt "Built-in dark theme | Theme default strings | name" +msgid "Default dark" +msgstr "デフォルトの暗い" + +#: main.cpp:368 +msgctxt "Main menu" +msgid "File" +msgstr "ファイル" + +#: main.cpp:369 +msgctxt "Main menu | File" +msgid "Open" +msgstr "開ける" + +#: main.cpp:371 +msgctxt "File dialog title" +msgid "Open..." +msgstr "開ける..." + +#: main.cpp:372 +msgctxt "File dialog filter name" +msgid "Audio files" +msgstr "オーディオファイル" + +#: main.cpp:375 +msgctxt "Main menu | File" +msgid "Quit" +msgstr "辞める" + +#: main.cpp:380 +msgctxt "Main menu" +msgid "Edit" +msgstr "編集" + +#: main.cpp:381 +msgctxt "Main menu | Edit" +msgid "Preferences..." +msgstr "設定..." + +#: main.cpp:387 +msgctxt "Main menu (in debug builds)" +msgid "Debug" +msgstr "デバッグ" + +#: main.cpp:388 +msgctxt "Main menu | Debug" +msgid "Show ImGui Demo Window" +msgstr "デモウィンドウを表示" + +#: main.cpp:394 +msgctxt "Main menu" +msgid "Help" +msgstr "ヘルプ" + +#: main.cpp:395 +msgctxt "Main menu | Help" +msgid "About" +msgstr "に関しては" + +#: main.cpp:403 +msgctxt "Main window title" +msgid "Player" +msgstr "プレーヤー" + +#: main.cpp:432 +#, c-format +msgctxt "Playback controls | slider" +msgid "Speed: %.2fx" +msgstr "速度: %.2fx" + +#: main.cpp:436 +#, c-format +msgctxt "Playback controls | slider" +msgid "Tempo: %.2fx" +msgstr "テン: %.2fx" + +#: main.cpp:440 +#, c-format +msgctxt "Playback controls | slider" +msgid "Pitch: %.2fx" +msgstr "ピッチ: %.2fx" + +#: main.cpp:448 +msgctxt "Window title, window opened by menu item" +msgid "Preferences..." +msgstr "設定..." + +#: main.cpp:450 +msgctxt "Preference | VSync checkbox" +msgid "Enable VSync" +msgstr "VSync を有効にする" + +#: main.cpp:455 +#, c-format +msgctxt "Preferences | Framerate slider" +msgid "Max framerate without VSync: %d" +msgstr "最大フレームレート: %d" + +#: main.cpp:456 +msgctxt "Preference | Related non-preference button" +msgid "Theme Editor" +msgstr "テーマエディタ" + +#: main.cpp:460 +msgctxt "Preference | override enable checkbox" +msgid "Override language" +msgstr "言語を上書きする" + +#: main.cpp:476 +msgctxt "Preference | Theme selector | Filter label" +msgid "Filter:" +msgstr "フィルター:" + +#: main.cpp:479 +msgctxt "Preferences | Theme selector | Selector label" +msgid "Select a theme..." +msgstr "テーマを選択する..." + +#: main.cpp:516 +#, c-format +msgctxt "" +"Preference | Accent hue slider, range 0-360 from HSV algorithm hue component" +msgid "Accent color hue: %.0f°" +msgstr "アクセントカラーの色相: %.0f°" + +#: main.cpp:524 +msgctxt "Window title, window opened by menu item" +msgid "About and Licenses" +msgstr "ライセンスについて" + +#: main.cpp:526 +msgctxt "" +"Application name - Japanese word should remain Japanese and stay the same " +"when translating for stylistic purposes." +msgid "ねこ Player" +msgstr "ねこ プレーヤー" + +#: main.cpp:530 +msgctxt "" +"Application name - Japanese word should be converted to the translated " +"language's characters. Use a string with only a single underscore to disable " +"for Japanese." +msgid "(Neko Player)" +msgstr "_" + +#: main.cpp:535 +msgctxt "Version string format specifier" +msgid "Version " +msgstr "バージョン " + +#: main.cpp:535 +msgctxt "Suffix to the version string in the about window, if needed" +msgid " " +msgstr "" + +#: main.cpp:541 +msgctxt "Library name" +msgid "SDL Mixer X" +msgstr "SDL Mixer X" + +#: main.cpp:542 +msgctxt "Library name" +msgid "JsonCpp" +msgstr "JsonCpp" + +#: main.cpp:543 +msgctxt "Library name" +msgid "SoundTouch" +msgstr "SoundTouch" + +#: main.cpp:544 +msgctxt "Library name" +msgid "libintl" +msgstr "libintl" + +#: main.cpp:545 +msgctxt "Library name" +msgid "Dear ImGui" +msgstr "Dear ImGui" + +#: main.cpp:546 +msgctxt "Library name" +msgid "imgui-filebrowser" +msgstr "imgui-filebrowser" + +#: main.cpp:548 +msgctxt "Library name" +msgid "libportal" +msgstr "libportal" + +#: main.cpp:550 +msgctxt "Library name" +msgid "Noto Sans" +msgstr "Noto Sans" + +#: main.cpp:551 +msgctxt "Library name" +msgid "Fork Awesome" +msgstr "Fork Awesome" + +#: main.cpp:552 +msgctxt "Library name" +msgid "IconFontCppHeaders" +msgstr "IconFontCppHeaders" + +#: main.cpp:577 +msgctxt "Project selector label." +msgid "Project" +msgstr "プロジェクト" + +#: main.cpp:592 +msgctxt "License viewer label" +msgid "License" +msgstr "ライセンス" + +#: main.cpp:595 +#, c-format +msgctxt "" +"License viewer | information above license - string 1: selected project, " +"string 2: SPDX license identifier" +msgid "%s: %s" +msgstr "%s: %s" + +#: theme.cpp:39 +msgctxt "Window title" +msgid "Theme Editor" +msgstr "テーマエディタ" + +#: theme.cpp:43 +msgctxt "Theme Editor | preset button" +msgid "Create light" +msgstr "ライトテーマを作成する" + +#: theme.cpp:52 +msgctxt "Theme Editor | preset button" +msgid "Create dark" +msgstr "ダークテーマを作成する" + +#: theme.cpp:60 +msgctxt "Theme Editor | import button. Opens the theme import file dialog" +msgid "Import..." +msgstr "インポート..." + +#: theme.cpp:61 +msgctxt "Theme Editor file dialog title" +msgid "Import theme..." +msgstr "テーマのインポート..." + +#: theme.cpp:62 theme.cpp:76 +msgctxt "Theme Editor file dialog filter name" +msgid "Theme JSON files" +msgstr "テーマの JSON ファイル" + +#: theme.cpp:74 +msgctxt "Theme Editor | export button. Opens the theme export file dialog" +msgid "Export..." +msgstr "テーマをエクス..." + +#: theme.cpp:75 +msgctxt "Theme Editor file dialog title" +msgid "Export theme..." +msgstr "テーマをエクスポート..." + +#: theme.cpp:98 +msgctxt "Theme Editor | button. Reverts to saved file." +msgid "Revert" +msgstr "元に戻す" + +#: theme.cpp:107 +msgctxt "" +"Theme Editor | button. Saves the theme to it's current location. Not shown " +"when it doesn't already have one." +msgid "Save" +msgstr "保存" + +#: theme.cpp:111 +msgctxt "" +"Theme Editor | button. Opens the theme loading dialog for themes created or " +"imported by the user." +msgid "Load..." +msgstr "オープン..." + +#: theme.cpp:115 +msgctxt "" +"Theme Editor | button. Opens the theme saving dialog for themes created or " +"imported by the user." +msgid "Save as..." +msgstr "に名前を付けて保存..." + +#: theme.cpp:120 +msgctxt "Theme Editor | slider. Simplified frame rounding." +msgid "Frame Rounding" +msgstr "フレームの丸め" + +#: theme.cpp:122 +msgctxt "Theme Editor | checkbox" +msgid "Window Border" +msgstr "ウィンドウの境界線" + +#: theme.cpp:124 +msgctxt "Theme Editor | checkbox" +msgid "Frame Border" +msgstr "フレームの境界線" + +#: theme.cpp:126 +msgctxt "Theme Editor | checkbox" +msgid "Popup Border" +msgstr "ポップアップウィンドウの境界線" + +#: theme.cpp:132 +msgctxt "Theme Editor | Tab label" +msgid "Strings" +msgstr "ストリングス" + +#: theme.cpp:134 +msgctxt "Theme Editor | Strings | Name input label" +msgid "Name" +msgstr "名前" + +#: theme.cpp:135 +msgctxt "Theme Editor | Strings | Description input label" +msgid "Description" +msgstr "形容" + +#: theme.cpp:139 +msgctxt "Theme Editor | Tab label" +msgid "Sizes" +msgstr "サイズ" + +#: theme.cpp:141 +msgctxt "Theme Editor | Sizes | Section label" +msgid "Sizing" +msgstr "サイズ" + +#: theme.cpp:142 +msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders" +msgid "Window Padding" +msgstr "ウィンドウのパディング" + +#: theme.cpp:143 +msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders" +msgid "Frame Padding" +msgstr "フレームのパディング" + +#: theme.cpp:144 +msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders" +msgid "Cell Padding" +msgstr "セルの余白" + +#: theme.cpp:145 +msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders" +msgid "Item Spacing" +msgstr "項目の間隔" + +#: theme.cpp:146 +msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders" +msgid "Inner Item Spacing" +msgstr "項目内の間隔" + +#: theme.cpp:149 +msgctxt "Theme Editor | Sizes | Sizing | slider label" +msgid "Scrollbar Size" +msgstr "スクロールバーのサイズ" + +#: theme.cpp:150 +msgctxt "Theme Editor | Sizes | Sizing | slider label" +msgid "Minimum Grabber Size" +msgstr "最小グラバーサイズ" + +#: theme.cpp:151 +msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders" +msgid "Separator Text Padding" +msgstr "区切りテキストの余白" + +#: theme.cpp:153 +msgctxt "Theme Editor | Sizes | Section label" +msgid "Borders" +msgstr "国境" + +#: theme.cpp:154 +msgctxt "Theme Editor | Sizes | Borders | slider label" +msgid "Window Border Size" +msgstr "ウィンドウの境界線のサイズ" + +#: theme.cpp:155 +msgctxt "Theme Editor | Sizes | Borders | slider label" +msgid "Child Border Size" +msgstr "子ウィンドウの境界線のサイズ" + +#: theme.cpp:156 +msgctxt "Theme Editor | Sizes | Borders | slider label" +msgid "Popup Border Size" +msgstr "ポップアップウィンドウの境界線のサイズ" + +#: theme.cpp:157 +msgctxt "Theme Editor | Sizes | Borders | slider label" +msgid "Frame Border Size" +msgstr "枠線サイズ" + +#: theme.cpp:158 +msgctxt "Theme Editor | Sizes | Borders | slider label" +msgid "Tab Border Size" +msgstr "タブの境界線のサイズ" + +#: theme.cpp:159 +msgctxt "Theme Editor | Sizes | Borders | slider label" +msgid "Separator Text Border Size" +msgstr "区切りテキストの境界線のサイズ" + +#: theme.cpp:161 +msgctxt "Theme Editor | Sizes | Section label" +msgid "Rounding" +msgstr "丸め" + +#: theme.cpp:162 +msgctxt "Theme Editor | Sizes | Rounding | slider label" +msgid "Window Rounding" +msgstr "ウィンドウの丸め" + +#: theme.cpp:163 +msgctxt "Theme Editor | Sizes | Rounding | slider label" +msgid "Child Rounding" +msgstr "子ウィンドウの丸め" + +#: theme.cpp:164 +msgctxt "Theme Editor | Sizes | Rounding | slider label" +msgid "Frame Rounding" +msgstr "フレームの丸め" + +#: theme.cpp:165 +msgctxt "Theme Editor | Sizes | Rounding | slider label" +msgid "Popup Rounding" +msgstr "ポップアップウィンドウの丸め" + +#: theme.cpp:166 +msgctxt "Theme Editor | Sizes | Rounding | slider label" +msgid "Scrollbar Rounding" +msgstr "スクロールバーの丸め" + +#: theme.cpp:167 +msgctxt "Theme Editor | Sizes | Rounding | slider label" +msgid "Grabber Rounding" +msgstr "グラバー丸め" + +#: theme.cpp:168 +msgctxt "Theme Editor | Sizes | Rounding | slider label" +msgid "Tab Rounding" +msgstr "タブの丸め" + +#: theme.cpp:173 +msgctxt "Theme Editor | Tab label" +msgid "Colors" +msgstr "色" + +#: theme.cpp:177 +msgctxt "Theme Editor | Colors | text filter" +msgid "Filter colors" +msgstr "フィルターの色" + +#: theme.cpp:180 +msgctxt "Theme Editor | Colors | preview settings radio button" +msgid "Opaque" +msgstr "オペーク" + +#: theme.cpp:181 +msgctxt "Theme Editor | Colors | preview settings radio button" +msgid "Alpha" +msgstr "アルファ" + +#: theme.cpp:182 +msgctxt "Theme Editor | Colors | preview settings radio button" +msgid "Both" +msgstr "両方とも" + +#: theme.cpp:193 +msgctxt "Theme Editor | Colors | (Any color) | recoloring checkbox" +msgid "Match hue preference" +msgstr "色相設定の一致" + +#: theme.cpp:230 theme.cpp:233 +msgctxt "Theme Editor | Custom modal dialog title" +msgid "Load..." +msgstr "オープン..." + +#: theme.cpp:236 +msgctxt "Theme Editor | Load dialog | Theme selector | filter label" +msgid "Filter:" +msgstr "フィルター:" + +#: theme.cpp:239 +msgctxt "Theme Editor | Load dialog | Theme selector | label" +msgid "Available themes..." +msgstr "利用可能なテーマ..." + +#: theme.cpp:255 +msgctxt "Theme Editor | Load dialog | Load button" +msgid "Load" +msgstr "負荷" + +#: theme.cpp:267 +msgctxt "Theme Editor | Load dialog | Cancel button" +msgid "Cancel" +msgstr "キャンセル" + +#: theme.cpp:276 theme.cpp:279 +msgctxt "Theme Editor | Custom modal dialog title" +msgid "Save as..." +msgstr "に名前を付けて保存..." + +#: theme.cpp:282 +msgctxt "Theme Editor | Save as dialog | Theme selector | filter label" +msgid "Filter:" +msgstr "フィルター:" + +#: theme.cpp:285 +msgctxt "Theme Editor | Save as dialog | Theme selector | label" +msgid "Available themes..." +msgstr "利用可能なテーマ..." + +#: theme.cpp:302 +msgctxt "Theme Editor | Save as dialog | Theme name input label" +msgid "Theme name: " +msgstr "テーマ名: " + +#: theme.cpp:303 +msgctxt "Theme Editor | Save as dialog | Save button" +msgid "Save" +msgstr "保存" + +#: theme.cpp:314 +msgctxt "Theme Editor | Save as dialog | Cancel button" +msgid "Cancel" +msgstr "キャンセル" + +#: theme.cpp:473 +msgctxt "Theme default strings | name" +msgid "A theme" +msgstr "テーマ" + +#: theme.cpp:474 +msgctxt "Theme default strings | description" +msgid "(No description)" +msgstr "(説明なし)" diff --git a/assets/translation/messages.pot b/assets/translations/neko_player.pot similarity index 57% rename from assets/translation/messages.pot rename to assets/translations/neko_player.pot index 9856da1..facb3a7 100644 --- a/assets/translation/messages.pot +++ b/assets/translations/neko_player.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Neko Player\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-25 08:11-0700\n" +"POT-Creation-Date: 2023-07-25 14:02-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: None\n" @@ -21,224 +21,234 @@ msgstr "" "X-Poedit-SearchPath-0: theme.cpp\n" "X-Poedit-SearchPath-1: main.cpp\n" -#: main.cpp:227 -msgctxt "File dialog title" -msgid "Open..." -msgstr "" - -#: main.cpp:228 -msgctxt "File dialog filter name" -msgid "Audio files" -msgstr "" - -#: main.cpp:280 -msgctxt "Built-in themes > Theme default strings > name" -msgid "(built-in)" -msgstr "" - -#: main.cpp:284 -msgctxt "Built-in light theme > Theme default strings > name" -msgid "Default light" +#: main.cpp:120 +msgctxt "Language name" +msgid "English (United States)" msgstr "" #: main.cpp:292 -msgctxt "Built-in dark theme > Theme default strings > name" +msgctxt "Built-in themes | Theme default strings | name" +msgid "(built-in)" +msgstr "" + +#: main.cpp:296 +msgctxt "Built-in light theme | Theme default strings | name" +msgid "Default light" +msgstr "" + +#: main.cpp:304 +msgctxt "Built-in dark theme | Theme default strings | name" msgid "Default dark" msgstr "" -#: main.cpp:356 +#: main.cpp:368 msgctxt "Main menu" msgid "File" msgstr "" -#: main.cpp:357 -msgctxt "Main menu > File" +#: main.cpp:369 +msgctxt "Main menu | File" msgid "Open" msgstr "" -#: main.cpp:360 -msgctxt "Main menu > File" +#: main.cpp:371 +msgctxt "File dialog title" +msgid "Open..." +msgstr "" + +#: main.cpp:372 +msgctxt "File dialog filter name" +msgid "Audio files" +msgstr "" + +#: main.cpp:375 +msgctxt "Main menu | File" msgid "Quit" msgstr "" -#: main.cpp:365 +#: main.cpp:380 msgctxt "Main menu" msgid "Edit" msgstr "" -#: main.cpp:366 -msgctxt "Main menu > Edit" +#: main.cpp:381 +msgctxt "Main menu | Edit" msgid "Preferences..." msgstr "" -#: main.cpp:372 +#: main.cpp:387 msgctxt "Main menu (in debug builds)" msgid "Debug" msgstr "" -#: main.cpp:373 -msgctxt "Main menu > Debug" +#: main.cpp:388 +msgctxt "Main menu | Debug" msgid "Show ImGui Demo Window" msgstr "" -#: main.cpp:379 +#: main.cpp:394 msgctxt "Main menu" msgid "Help" msgstr "" -#: main.cpp:380 -msgctxt "Main menu > Help" +#: main.cpp:395 +msgctxt "Main menu | Help" msgid "About" msgstr "" -#: main.cpp:388 +#: main.cpp:403 msgctxt "Main window title" msgid "Player" msgstr "" -#: main.cpp:417 +#: main.cpp:432 #, c-format -msgctxt "Playback controls > slider" +msgctxt "Playback controls | slider" msgid "Speed: %.2fx" msgstr "" -#: main.cpp:421 +#: main.cpp:436 #, c-format -msgctxt "Playback controls > slider" +msgctxt "Playback controls | slider" msgid "Tempo: %.2fx" msgstr "" -#: main.cpp:425 -#, c-format -msgctxt "Playback controls > slider" -msgid "Pitch: %.2fx" -msgstr "" - -#: main.cpp:433 -msgctxt "Window title, window opened by menu item" -msgid "Preferences..." -msgstr "" - -#: main.cpp:435 -msgctxt "Preference > VSync checkbox" -msgid "Enable VSync" -msgstr "" - #: main.cpp:440 #, c-format -msgctxt "Preferences > Framerate slider" -msgid "Max framerate without VSync: %d" -msgstr "" - -#: main.cpp:441 -msgctxt "Preference > Related non-preference button" -msgid "Theme Editor" -msgstr "" - -#: main.cpp:445 -msgctxt "Preference > Theme selector > Filter label" -msgid "Filter:" +msgctxt "Playback controls | slider" +msgid "Pitch: %.2fx" msgstr "" #: main.cpp:448 -msgctxt "Preferences > Theme selector > Selector label" +msgctxt "Window title, window opened by menu item" +msgid "Preferences..." +msgstr "" + +#: main.cpp:450 +msgctxt "Preference | VSync checkbox" +msgid "Enable VSync" +msgstr "" + +#: main.cpp:455 +#, c-format +msgctxt "Preferences | Framerate slider" +msgid "Max framerate without VSync: %d" +msgstr "" + +#: main.cpp:456 +msgctxt "Preference | Related non-preference button" +msgid "Theme Editor" +msgstr "" + +#: main.cpp:460 +msgctxt "Preference | override enable checkbox" +msgid "Override language" +msgstr "" + +#: main.cpp:476 +msgctxt "Preference | Theme selector | Filter label" +msgid "Filter:" +msgstr "" + +#: main.cpp:479 +msgctxt "Preferences | Theme selector | Selector label" msgid "Select a theme..." msgstr "" -#: main.cpp:485 +#: main.cpp:516 #, c-format -msgctxt "Preference > Accent hue slider, range 0-360 from HSV algorithm hue component" +msgctxt "Preference | Accent hue slider, range 0-360 from HSV algorithm hue component" msgid "Accent color hue: %.0f°" msgstr "" -#: main.cpp:493 +#: main.cpp:524 msgctxt "Window title, window opened by menu item" msgid "About and Licenses" msgstr "" -#: main.cpp:495 +#: main.cpp:526 msgctxt "Application name - Japanese word should remain Japanese and stay the same when translating for stylistic purposes." msgid "ねこ Player" msgstr "" -#: main.cpp:499 -msgctxt "Application name - Japanese word should be converted to the translated language's characters. Use an empty string to disable for Japanese." +#: main.cpp:530 +msgctxt "Application name - Japanese word should be converted to the translated language's characters. Use a string with only a single underscore to disable for Japanese." msgid "(Neko Player)" msgstr "" -#: main.cpp:504 +#: main.cpp:535 msgctxt "Version string format specifier" msgid "Version " msgstr "" -#: main.cpp:504 +#: main.cpp:535 msgctxt "Suffix to the version string in the about window, if needed" msgid " " msgstr "" -#: main.cpp:510 +#: main.cpp:541 msgctxt "Library name" msgid "SDL Mixer X" msgstr "" -#: main.cpp:511 +#: main.cpp:542 msgctxt "Library name" msgid "JsonCpp" msgstr "" -#: main.cpp:512 +#: main.cpp:543 msgctxt "Library name" msgid "SoundTouch" msgstr "" -#: main.cpp:513 +#: main.cpp:544 msgctxt "Library name" msgid "libintl" msgstr "" -#: main.cpp:514 +#: main.cpp:545 msgctxt "Library name" msgid "Dear ImGui" msgstr "" -#: main.cpp:515 +#: main.cpp:546 msgctxt "Library name" msgid "imgui-filebrowser" msgstr "" -#: main.cpp:517 +#: main.cpp:548 msgctxt "Library name" msgid "libportal" msgstr "" -#: main.cpp:519 +#: main.cpp:550 msgctxt "Library name" msgid "Noto Sans" msgstr "" -#: main.cpp:520 +#: main.cpp:551 msgctxt "Library name" msgid "Fork Awesome" msgstr "" -#: main.cpp:521 +#: main.cpp:552 msgctxt "Library name" msgid "IconFontCppHeaders" msgstr "" -#: main.cpp:546 +#: main.cpp:577 msgctxt "Project selector label." msgid "Project" msgstr "" -#: main.cpp:561 +#: main.cpp:592 msgctxt "License viewer label" msgid "License" msgstr "" -#: main.cpp:564 +#: main.cpp:595 #, c-format -msgctxt "License viewer > information above license - string 1: selected project, string 2: SPDX license identifier" +msgctxt "License viewer | information above license - string 1: selected project, string 2: SPDX license identifier" msgid "%s: %s" msgstr "" @@ -248,17 +258,17 @@ msgid "Theme Editor" msgstr "" #: theme.cpp:43 -msgctxt "Theme Editor > preset button" +msgctxt "Theme Editor | preset button" msgid "Create light" msgstr "" #: theme.cpp:52 -msgctxt "Theme Editor > preset button" +msgctxt "Theme Editor | preset button" msgid "Create dark" msgstr "" #: theme.cpp:60 -msgctxt "Theme Editor > import button. Opens the theme import file dialog" +msgctxt "Theme Editor | import button. Opens the theme import file dialog" msgid "Import..." msgstr "" @@ -273,7 +283,7 @@ msgid "Theme JSON files" msgstr "" #: theme.cpp:74 -msgctxt "Theme Editor > export button. Opens the theme export file dialog" +msgctxt "Theme Editor | export button. Opens the theme export file dialog" msgid "Export..." msgstr "" @@ -283,276 +293,276 @@ msgid "Export theme..." msgstr "" #: theme.cpp:98 -msgctxt "Theme Editor > button. Reverts to saved file." +msgctxt "Theme Editor | button. Reverts to saved file." msgid "Revert" msgstr "" #: theme.cpp:107 -msgctxt "Theme Editor > button. Saves the theme to it's current location. Not shown when it doesn't already have one." +msgctxt "Theme Editor | button. Saves the theme to it's current location. Not shown when it doesn't already have one." msgid "Save" msgstr "" #: theme.cpp:111 -msgctxt "Theme Editor > button. Opens the theme loading dialog for themes created or imported by the user." +msgctxt "Theme Editor | button. Opens the theme loading dialog for themes created or imported by the user." msgid "Load..." msgstr "" #: theme.cpp:115 -msgctxt "Theme Editor > button. Opens the theme saving dialog for themes created or imported by the user." +msgctxt "Theme Editor | button. Opens the theme saving dialog for themes created or imported by the user." msgid "Save as..." msgstr "" #: theme.cpp:120 -msgctxt "Theme Editor > slider. Simplified frame rounding." +msgctxt "Theme Editor | slider. Simplified frame rounding." msgid "Frame Rounding" msgstr "" #: theme.cpp:122 -msgctxt "Theme Editor > checkbox" +msgctxt "Theme Editor | checkbox" msgid "Window Border" msgstr "" #: theme.cpp:124 -msgctxt "Theme Editor > checkbox" +msgctxt "Theme Editor | checkbox" msgid "Frame Border" msgstr "" #: theme.cpp:126 -msgctxt "Theme Editor > checkbox" +msgctxt "Theme Editor | checkbox" msgid "Popup Border" msgstr "" #: theme.cpp:132 -msgctxt "Theme Editor > Tab label" +msgctxt "Theme Editor | Tab label" msgid "Strings" msgstr "" #: theme.cpp:134 -msgctxt "Theme Editor > Strings > Name input label" +msgctxt "Theme Editor | Strings | Name input label" msgid "Name" msgstr "" #: theme.cpp:135 -msgctxt "Theme Editor > Strings > Description input label" +msgctxt "Theme Editor | Strings | Description input label" msgid "Description" msgstr "" #: theme.cpp:139 -msgctxt "Theme Editor > Tab label" +msgctxt "Theme Editor | Tab label" msgid "Sizes" msgstr "" #: theme.cpp:141 -msgctxt "Theme Editor > Sizes > Section label" +msgctxt "Theme Editor | Sizes | Section label" msgid "Sizing" msgstr "" #: theme.cpp:142 -msgctxt "Theme Editor > Sizes > Sizing > label of XY sliders" +msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders" msgid "Window Padding" msgstr "" #: theme.cpp:143 -msgctxt "Theme Editor > Sizes > Sizing > label of XY sliders" +msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders" msgid "Frame Padding" msgstr "" #: theme.cpp:144 -msgctxt "Theme Editor > Sizes > Sizing > label of XY sliders" +msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders" msgid "Cell Padding" msgstr "" #: theme.cpp:145 -msgctxt "Theme Editor > Sizes > Sizing > label of XY sliders" +msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders" msgid "Item Spacing" msgstr "" #: theme.cpp:146 -msgctxt "Theme Editor > Sizes > Sizing > label of XY sliders" +msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders" msgid "Inner Item Spacing" msgstr "" #: theme.cpp:149 -msgctxt "Theme Editor > Sizes > Sizing > slider label" +msgctxt "Theme Editor | Sizes | Sizing | slider label" msgid "Scrollbar Size" msgstr "" #: theme.cpp:150 -msgctxt "Theme Editor > Sizes > Sizing > slider label" +msgctxt "Theme Editor | Sizes | Sizing | slider label" msgid "Minimum Grabber Size" msgstr "" #: theme.cpp:151 -msgctxt "Theme Editor > Sizes > Sizing > label of XY sliders" +msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders" msgid "Separator Text Padding" msgstr "" #: theme.cpp:153 -msgctxt "Theme Editor > Sizes > Section label" +msgctxt "Theme Editor | Sizes | Section label" msgid "Borders" msgstr "" #: theme.cpp:154 -msgctxt "Theme Editor > Sizes > Borders > slider label" +msgctxt "Theme Editor | Sizes | Borders | slider label" msgid "Window Border Size" msgstr "" #: theme.cpp:155 -msgctxt "Theme Editor > Sizes > Borders > slider label" +msgctxt "Theme Editor | Sizes | Borders | slider label" msgid "Child Border Size" msgstr "" #: theme.cpp:156 -msgctxt "Theme Editor > Sizes > Borders > slider label" +msgctxt "Theme Editor | Sizes | Borders | slider label" msgid "Popup Border Size" msgstr "" #: theme.cpp:157 -msgctxt "Theme Editor > Sizes > Borders > slider label" +msgctxt "Theme Editor | Sizes | Borders | slider label" msgid "Frame Border Size" msgstr "" #: theme.cpp:158 -msgctxt "Theme Editor > Sizes > Borders > slider label" +msgctxt "Theme Editor | Sizes | Borders | slider label" msgid "Tab Border Size" msgstr "" #: theme.cpp:159 -msgctxt "Theme Editor > Sizes > Borders > slider label" +msgctxt "Theme Editor | Sizes | Borders | slider label" msgid "Separator Text Border Size" msgstr "" #: theme.cpp:161 -msgctxt "Theme Editor > Sizes > Section label" +msgctxt "Theme Editor | Sizes | Section label" msgid "Rounding" msgstr "" #: theme.cpp:162 -msgctxt "Theme Editor > Sizes > Rounding > slider label" +msgctxt "Theme Editor | Sizes | Rounding | slider label" msgid "Window Rounding" msgstr "" #: theme.cpp:163 -msgctxt "Theme Editor > Sizes > Rounding > slider label" +msgctxt "Theme Editor | Sizes | Rounding | slider label" msgid "Child Rounding" msgstr "" #: theme.cpp:164 -msgctxt "Theme Editor > Sizes > Rounding > slider label" +msgctxt "Theme Editor | Sizes | Rounding | slider label" msgid "Frame Rounding" msgstr "" #: theme.cpp:165 -msgctxt "Theme Editor > Sizes > Rounding > slider label" +msgctxt "Theme Editor | Sizes | Rounding | slider label" msgid "Popup Rounding" msgstr "" #: theme.cpp:166 -msgctxt "Theme Editor > Sizes > Rounding > slider label" +msgctxt "Theme Editor | Sizes | Rounding | slider label" msgid "Scrollbar Rounding" msgstr "" #: theme.cpp:167 -msgctxt "Theme Editor > Sizes > Rounding > slider label" +msgctxt "Theme Editor | Sizes | Rounding | slider label" msgid "Grabber Rounding" msgstr "" #: theme.cpp:168 -msgctxt "Theme Editor > Sizes > Rounding > slider label" +msgctxt "Theme Editor | Sizes | Rounding | slider label" msgid "Tab Rounding" msgstr "" #: theme.cpp:173 -msgctxt "Theme Editor > Tab label" +msgctxt "Theme Editor | Tab label" msgid "Colors" msgstr "" #: theme.cpp:177 -msgctxt "Theme Editor > Colors > text filter" +msgctxt "Theme Editor | Colors | text filter" msgid "Filter colors" msgstr "" #: theme.cpp:180 -msgctxt "Theme Editor > Colors > preview settings radio button" +msgctxt "Theme Editor | Colors | preview settings radio button" msgid "Opaque" msgstr "" #: theme.cpp:181 -msgctxt "Theme Editor > Colors > preview settings radio button" +msgctxt "Theme Editor | Colors | preview settings radio button" msgid "Alpha" msgstr "" #: theme.cpp:182 -msgctxt "Theme Editor > Colors > preview settings radio button" +msgctxt "Theme Editor | Colors | preview settings radio button" msgid "Both" msgstr "" #: theme.cpp:193 -msgctxt "Theme Editor > Colors > (Any color) > recoloring checkbox" +msgctxt "Theme Editor | Colors | (Any color) | recoloring checkbox" msgid "Match hue preference" msgstr "" #: theme.cpp:230 theme.cpp:233 -msgctxt "Theme Editor > Custom modal dialog title" +msgctxt "Theme Editor | Custom modal dialog title" msgid "Load..." msgstr "" #: theme.cpp:236 -msgctxt "Theme Editor > Load dialog > Theme selector > filter label" +msgctxt "Theme Editor | Load dialog | Theme selector | filter label" msgid "Filter:" msgstr "" #: theme.cpp:239 -msgctxt "Theme Editor > Load dialog > Theme selector > label" +msgctxt "Theme Editor | Load dialog | Theme selector | label" msgid "Available themes..." msgstr "" #: theme.cpp:255 -msgctxt "Theme Editor > Load dialog > Load button" +msgctxt "Theme Editor | Load dialog | Load button" msgid "Load" msgstr "" #: theme.cpp:267 -msgctxt "Theme Editor > Load dialog > Cancel button" +msgctxt "Theme Editor | Load dialog | Cancel button" msgid "Cancel" msgstr "" #: theme.cpp:276 theme.cpp:279 -msgctxt "Theme Editor > Custom modal dialog title" +msgctxt "Theme Editor | Custom modal dialog title" msgid "Save as..." msgstr "" #: theme.cpp:282 -msgctxt "Theme Editor > Save as dialog > Theme selector > filter label" +msgctxt "Theme Editor | Save as dialog | Theme selector | filter label" msgid "Filter:" msgstr "" #: theme.cpp:285 -msgctxt "Theme Editor > Save as dialog > Theme selector > label" +msgctxt "Theme Editor | Save as dialog | Theme selector | label" msgid "Available themes..." msgstr "" #: theme.cpp:302 -msgctxt "Theme Editor > Save as dialog > Theme name input label" +msgctxt "Theme Editor | Save as dialog | Theme name input label" msgid "Theme name: " msgstr "" #: theme.cpp:303 -msgctxt "Theme Editor > Save as dialog > Save button" +msgctxt "Theme Editor | Save as dialog | Save button" msgid "Save" msgstr "" #: theme.cpp:314 -msgctxt "Theme Editor > Save as dialog > Cancel button" +msgctxt "Theme Editor | Save as dialog | Cancel button" msgid "Cancel" msgstr "" #: theme.cpp:473 -msgctxt "Theme default strings > name" +msgctxt "Theme default strings | name" msgid "A theme" msgstr "" #: theme.cpp:474 -msgctxt "Theme default strings > description" +msgctxt "Theme default strings | description" msgid "(No description)" msgstr "" diff --git a/install.sh b/install.sh deleted file mode 100755 index d74759f..0000000 --- a/install.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -./build-file.sh -flatpak install --reinstall -y --user --noninteractive ./neko-player.flatpak diff --git a/main.cpp b/main.cpp index a15a266..fa69035 100644 --- a/main.cpp +++ b/main.cpp @@ -113,7 +113,11 @@ ImFont *add_font(vector data_vec, int size = 13) { // Main code int main(int, char**) { + setlocale(LC_ALL, ""); bindtextdomain("neko_player", LOCALE_DIR); + textdomain("neko_player"); + printf("Loaded locale '%s' from '%s'...\n", CURRENT_LANGUAGE, LOCALE_DIR); + printf("Locale name: %s\n", _TR_CTX("Language name", "English (United States)")); #ifdef PORTALS g_set_application_name("Neko Player"); #endif @@ -224,8 +228,6 @@ int main(int, char**) ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f); FileBrowser fileDialog(false, ImGuiFileBrowserFlags_NoTitleBar|ImGuiFileBrowserFlags_NoMove|ImGuiFileBrowserFlags_NoResize); - fileDialog.SetTitle(_TR_CTX("File dialog title", "Open...")); - fileDialog.SetTypeFilters(_TR_CTX("File dialog filter name", "Audio files"), { ".wav", ".ogg", ".mp3", ".qoa", ".flac", ".xm", ".mod"}); std::string userdir = std::getenv( #ifdef _WIN32 "UserProfile" @@ -246,6 +248,7 @@ int main(int, char**) bool stopped = true; bool vsync = false; bool about_window = false; + string lang; int framerate = 60; { Json::Value config; @@ -272,16 +275,25 @@ int main(int, char**) if (config.isMember("framerate")) { framerate = config["framerate"].asUInt(); } + if (config.isMember("lang")) { + Json::Value langValue; + if (langValue.isNull()) { + lang = DEFAULT_LANG; + } else { + lang = config["lang"].asString(); + } + SET_LANG(lang.c_str()); + } stream.close(); } if (is_empty(Theme::themeDir)) { path lightPath = Theme::themeDir / "light.json"; path darkPath = Theme::themeDir / "dark.json"; - string builtinDescription = _TRS_CTX("Built-in themes > Theme default strings > name", "(built-in)"); + string builtinDescription = _TRS_CTX("Built-in themes | Theme default strings | name", "(built-in)"); if (!exists(lightPath)) { Theme light(false); ThemeStrings &strings = light.strings["fallback"]; - strings.name = _TRS_CTX("Built-in light theme > Theme default strings > name", "Default light"); + strings.name = _TRS_CTX("Built-in light theme | Theme default strings | name", "Default light"); strings.description = builtinDescription; light.strings[CURRENT_LANGUAGE] = strings; light.Save(lightPath); @@ -289,7 +301,7 @@ int main(int, char**) if (!exists(darkPath)) { Theme dark(true); ThemeStrings &strings = dark.strings["fallback"]; - strings.name = _TRS_CTX("Built-in dark theme > Theme default strings > name", "Default dark"); + strings.name = _TRS_CTX("Built-in dark theme | Theme default strings | name", "Default dark"); strings.description = builtinDescription; dark.strings[CURRENT_LANGUAGE] = strings; dark.Save(darkPath); @@ -354,30 +366,33 @@ int main(int, char**) ImGui::ShowDemoWindow(&show_demo_window); if (ImGui::BeginMainMenuBar()) { if (ImGui::BeginMenu(_TRI_CTX(ICON_FK_FILE, "Main menu", "File"))) { - if (ImGui::MenuItem(_TRI_CTX(ICON_FK_FOLDER_OPEN, "Main menu > File", "Open"))) { + if (ImGui::MenuItem(_TRI_CTX(ICON_FK_FOLDER_OPEN, "Main menu | File", "Open"))) { + // Set translatable strings here so that they are in the correct language even when it changes at runtime. + fileDialog.SetTitle(_TR_CTX("File dialog title", "Open...")); + fileDialog.SetTypeFilters(_TR_CTX("File dialog filter name", "Audio files"), { ".wav", ".ogg", ".mp3", ".qoa", ".flac", ".xm", ".mod"}); fileDialog.Open(); } - if (ImGui::MenuItem(_TRI_CTX(ICON_FK_WINDOW_CLOSE, "Main menu > File", "Quit"))) { + if (ImGui::MenuItem(_TRI_CTX(ICON_FK_WINDOW_CLOSE, "Main menu | File", "Quit"))) { done = true; } ImGui::EndMenu(); } if (ImGui::BeginMenu(_TRI_CTX(ICON_FK_SCISSORS,"Main menu", "Edit"))) { - if (ImGui::MenuItem(_TRI_CTX(ICON_FK_COG, "Main menu > Edit", "Preferences..."))) { + if (ImGui::MenuItem(_TRI_CTX(ICON_FK_COG, "Main menu | Edit", "Preferences..."))) { prefs_window = true; } ImGui::EndMenu(); } #ifdef DEBUG if (ImGui::BeginMenu(_TRI_CTX(ICON_FK_COG, "Main menu (in debug builds)", "Debug"))) { - if (ImGui::MenuItem(_TR_CTX("Main menu > Debug", "Show ImGui Demo Window"), nullptr, show_demo_window)) { + if (ImGui::MenuItem(_TR_CTX("Main menu | Debug", "Show ImGui Demo Window"), nullptr, show_demo_window)) { show_demo_window = !show_demo_window; } ImGui::EndMenu(); } #endif if (ImGui::BeginMenu(_TRI_CTX(ICON_FK_INFO_CIRCLE, "Main menu", "Help"))) { - if (ImGui::MenuItem(_TRI_CTX(ICON_FK_INFO, "Main menu > Help", "About"), nullptr, about_window)) { + if (ImGui::MenuItem(_TRI_CTX(ICON_FK_INFO, "Main menu | Help", "About"), nullptr, about_window)) { about_window = !about_window; } ImGui::EndMenu(); @@ -414,15 +429,15 @@ int main(int, char**) const float items = 3.0f; const float between_items = items - 1.0f; ImGui::PushItemWidth((ImGui::GetWindowWidth() / items) - (ImGui::GetStyle().ItemSpacing.x / (items / between_items)) - ((ImGui::GetStyle().WindowPadding.x / items) * 2.0f)); - if (ImGui::SliderFloat("##Speed", &playback->speed, 0.25, 4.0, _TR_CTX("Playback controls > slider", "Speed: %.2fx"), ImGuiSliderFlags_Logarithmic)) { + if (ImGui::SliderFloat("##Speed", &playback->speed, 0.25, 4.0, _TR_CTX("Playback controls | slider", "Speed: %.2fx"), ImGuiSliderFlags_Logarithmic)) { playback->Update(); } ImGui::SameLine(); - if (ImGui::SliderFloat("##Tempo", &playback->tempo, 0.25, 4.0, _TR_CTX("Playback controls > slider", "Tempo: %.2fx"), ImGuiSliderFlags_Logarithmic)) { + if (ImGui::SliderFloat("##Tempo", &playback->tempo, 0.25, 4.0, _TR_CTX("Playback controls | slider", "Tempo: %.2fx"), ImGuiSliderFlags_Logarithmic)) { playback->Update(); } ImGui::SameLine(); - if (ImGui::SliderFloat("##Pitch", &playback->pitch, 0.25, 4.0, _TR_CTX("Playback controls > slider", "Pitch: %.2fx"), ImGuiSliderFlags_Logarithmic)) { + if (ImGui::SliderFloat("##Pitch", &playback->pitch, 0.25, 4.0, _TR_CTX("Playback controls | slider", "Pitch: %.2fx"), ImGuiSliderFlags_Logarithmic)) { playback->Update(); } ImGui::PopItemWidth(); @@ -432,20 +447,36 @@ int main(int, char**) ImGui::SetNextWindowDockID(dockid); ImGui::Begin(_TRI_CTX(ICON_FK_COG, "Window title, window opened by menu item", "Preferences..."), &prefs_window); { - if (ImGui::Checkbox(_TR_CTX("Preference > VSync checkbox", "Enable VSync"), &vsync)) { + if (ImGui::Checkbox(_TR_CTX("Preference | VSync checkbox", "Enable VSync"), &vsync)) { SDL_GL_SetSwapInterval(vsync ? 1 : 0); } ImGui::SameLine(); ImGui::SetNextItemWidth(ImGui::GetWindowWidth() - ImGui::GetCursorPosX() - ImGui::GetStyle().WindowPadding.x); - ImGui::SliderInt("##Framerate", &framerate, 10, 480, _TR_CTX("Preferences > Framerate slider", "Max framerate without VSync: %d")); - if (ImGui::Button(_TRI_CTX(ICON_FK_MAGIC, "Preference > Related non-preference button", "Theme Editor"), ImVec2(ImGui::GetWindowWidth() - (ImGui::GetStyle().WindowPadding.x * 2.0f), 0))) { + ImGui::SliderInt("##Framerate", &framerate, 10, 480, _TR_CTX("Preferences | Framerate slider", "Max framerate without VSync: %d")); + if (ImGui::Button(_TRI_CTX(ICON_FK_MAGIC, "Preference | Related non-preference button", "Theme Editor"), ImVec2(ImGui::GetWindowWidth() - (ImGui::GetStyle().WindowPadding.x * 2.0f), 0))) { theme_editor = true; } + static bool override_lang = lang != DEFAULT_LANG; + if (ImGui::Checkbox(_TR_CTX("Preference | override enable checkbox", "Override language"), &override_lang)) { + if (!override_lang) { + lang = DEFAULT_LANG; + SET_LANG(lang.c_str()); + } + } + if (override_lang) { + ImGui::SameLine(); + ImGui::SetNextItemWidth(ImGui::GetWindowWidth() - ImGui::GetCursorPosX() - (ImGui::GetFontSize()) - ((ImGui::GetStyle().ItemSpacing.x + (ImGui::GetStyle().FramePadding.x * 2.0f))) - (ImGui::GetStyle().WindowPadding.x)); + ImGui::InputText("##LanguageOverrideTextBox", &lang); + ImGui::SameLine(); + if (ImGui::Button(ICON_FK_CHECK)) { + SET_LANG(lang.c_str()); + } + } static string filter = ""; - ImGui::Text(_TR_CTX("Preference > Theme selector > Filter label", "Filter:")); ImGui::SameLine(); + ImGui::Text(_TR_CTX("Preference | Theme selector | Filter label", "Filter:")); ImGui::SameLine(); ImGui::SetNextItemWidth(ImGui::GetWindowWidth() - ImGui::GetCursorPosX() - ImGui::GetStyle().WindowPadding.x); ImGui::InputText("##FilterInput", &filter); - ImGui::Text(_TR_CTX("Preferences > Theme selector > Selector label", "Select a theme...")); + ImGui::Text(_TR_CTX("Preferences | Theme selector | Selector label", "Select a theme...")); ImVec2 ChildSize = ImVec2(ImGui::GetWindowWidth() - (ImGui::GetStyle().WindowPadding.x * 2.0f), -ImGui::GetFrameHeightWithSpacing()); if (ImGui::BeginChildFrame(ImGui::GetID("##ThemesContainer"), ChildSize)) { ImVec2 TableSize = ImVec2(0, 0); @@ -482,7 +513,7 @@ int main(int, char**) } ImGui::EndChildFrame(); ImGui::SetNextItemWidth(ImGui::GetWindowWidth() - (ImGui::GetStyle().WindowPadding.x * 2)); - if (ImGui::SliderFloat("##AccentColor", &accent_color, 0.0, 360.0, _TR_CTX("Preference > Accent hue slider, range 0-360 from HSV algorithm hue component", "Accent color hue: %.0f°"), ImGuiSliderFlags_NoRoundToFormat)) { + if (ImGui::SliderFloat("##AccentColor", &accent_color, 0.0, 360.0, _TR_CTX("Preference | Accent hue slider, range 0-360 from HSV algorithm hue component", "Accent color hue: %.0f°"), ImGuiSliderFlags_NoRoundToFormat)) { theme->Apply(accent_color); } } @@ -496,8 +527,8 @@ int main(int, char**) ImGui::SetCursorPosX((ImGui::GetWindowWidth() - ImGui::GetFont()->CalcTextSizeA(ImGui::GetFontSize(), FLT_MAX, 0.0f, APP_NAME_STR.c_str()).x) / 2.0f); ImGui::Text(APP_NAME_STR.c_str()); ImGui::PopFont(); - static const string APP_NAME_ROMANIZED = _TR_CTX("Application name - Japanese word should be converted to the translated language's characters. Use an empty string to disable for Japanese.", "(Neko Player)"); - if (APP_NAME_ROMANIZED != "") { + static const string APP_NAME_ROMANIZED = _TR_CTX("Application name - Japanese word should be converted to the translated language's characters. Use a string with only a single underscore to disable for Japanese.", "(Neko Player)"); + if (APP_NAME_ROMANIZED != "_") { ImGui::SetCursorPosX((ImGui::GetWindowWidth() - ImGui::GetFont()->CalcTextSizeA(ImGui::GetFontSize(), FLT_MAX, 0.0f, APP_NAME_ROMANIZED.c_str()).x) / 2.0f); ImGui::Text(APP_NAME_ROMANIZED.c_str()); } @@ -561,7 +592,7 @@ int main(int, char**) ImGui::TextUnformatted(_TR_CTX("License viewer label", "License")); // Next string is internal. ImGui::BeginChild("license view", ImVec2(0, 0), true); // *don't* leave room for the nonexistant line below us! - ImGui::Text(_TR_CTX("License viewer > information above license - string 1: selected project, string 2: SPDX license identifier", "%s: %s"), selected.Project.c_str(), selected.Spdx.c_str()); + ImGui::Text(_TR_CTX("License viewer | information above license - string 1: selected project, string 2: SPDX license identifier", "%s: %s"), selected.Project.c_str(), selected.Spdx.c_str()); ImGui::Separator(); ImGui::TextWrapped("%s", selected.LicenseContents.c_str()); ImGui::EndChild(); @@ -640,6 +671,11 @@ int main(int, char**) config["demo_window"] = show_demo_window; config["vsync"] = vsync; config["framerate"] = framerate; + if (lang == DEFAULT_LANG) { + config["lang"] = Json::Value::nullSingleton(); + } else { + config["lang"] = lang; + } stream << config; stream.close(); } diff --git a/meson.build b/meson.build index 55b4858..f2349b7 100644 --- a/meson.build +++ b/meson.build @@ -11,7 +11,7 @@ if get_option('gles') or target_machine.cpu_family() == 'aarch64' or target_mach endif cfg_data = configuration_data() cfg_data.set('DEBUG', get_option('debug')) -cfg_data.set('LOCALE_DIR', get_option('localedir')) +cfg_data.set('LOCALE_DIR', get_option('prefix') / get_option('localedir')) # SDL Mixer X smx_opts = cmake.subproject_options() smx_opts.add_cmake_defines({'SDL_MIXER_X_STATIC': true, 'SDL_MIXER_X_SHARED': false, 'USE_MIDI_NATIVE_ALT': false, 'USE_MIDI_NATIVE': false}) @@ -93,6 +93,7 @@ endif install_data('assets/icon.svg', rename: 'neko-player.svg', install_dir: 'share/icons/hicolor/scalable/apps/') install_data('assets/neko-player.desktop', install_dir: 'share/applications') install_data('assets/com.experimentalcraft.NekoPlayer.metainfo.xml', install_dir: 'share/metainfo') +install_subdir('assets/translations/', exclude_files: 'neko_player.pot', strip_directory: true, install_dir: get_option('localedir')) exe = executable('neko-player', srcs, dependencies: deps, include_directories: include_dirs, diff --git a/theme.cpp b/theme.cpp index 4f37d63..40d9816 100644 --- a/theme.cpp +++ b/theme.cpp @@ -40,7 +40,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid ImGuiStyle& style = theme->style; ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.50f); ImVec2 buttonSize = ImVec2((ImGui::GetWindowWidth() * 0.50f) - (ImGui::GetStyle().WindowPadding.x) - (ImGui::GetStyle().ItemSpacing.x * 0.5f), 0); - if (ImGui::Button(_TR_CTX("Theme Editor > preset button", "Create light"), buttonSize)) { + if (ImGui::Button(_TR_CTX("Theme Editor | preset button", "Create light"), buttonSize)) { delete theme; theme = new Theme(false); @@ -49,7 +49,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid return true; } ImGui::SameLine(); - if (ImGui::Button(_TR_CTX("Theme Editor > preset button", "Create dark"), buttonSize)) { + if (ImGui::Button(_TR_CTX("Theme Editor | preset button", "Create dark"), buttonSize)) { delete theme; theme = new Theme(true); @@ -57,7 +57,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid ImGui::End(); return true; } - if (ImGui::Button(_TR_CTX("Theme Editor > import button. Opens the theme import file dialog", "Import..."), buttonSize)) { + if (ImGui::Button(_TR_CTX("Theme Editor | import button. Opens the theme import file dialog", "Import..."), buttonSize)) { importDialog.SetTitle(_TR_CTX("Theme Editor file dialog title", "Import theme...")); importDialog.SetTypeFilters(_TR_CTX("Theme Editor file dialog filter name", "Theme JSON files"), { ".json"}); std::string userdir = std::getenv( @@ -71,7 +71,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid importDialog.Open(); } ImGui::SameLine(); - if (ImGui::Button(_TR_CTX("Theme Editor > export button. Opens the theme export file dialog", "Export..."), buttonSize)) { + if (ImGui::Button(_TR_CTX("Theme Editor | export button. Opens the theme export file dialog", "Export..."), buttonSize)) { exportDialog.SetTitle(_TR_CTX("Theme Editor file dialog title", "Export theme...")); exportDialog.SetTypeFilters(_TR_CTX("Theme Editor file dialog filter name", "Theme JSON files"), { ".json"}); std::string userdir = std::getenv( @@ -95,7 +95,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid importDialog.Display(); exportDialog.Display(); if (!theme->file_path.empty()) { - if (ImGui::Button(_TR_CTX("Theme Editor > button. Reverts to saved file.", "Revert"), buttonSize)) { + if (ImGui::Button(_TR_CTX("Theme Editor | button. Reverts to saved file.", "Revert"), buttonSize)) { string file_path_backup = theme->file_path; delete theme; theme = new Theme(file_path_backup); @@ -104,82 +104,82 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid return true; } ImGui::SameLine(); - if (ImGui::Button(_TR_CTX("Theme Editor > button. Saves the theme to it's current location. Not shown when it doesn't already have one.", "Save"), buttonSize)) { + if (ImGui::Button(_TR_CTX("Theme Editor | button. Saves the theme to it's current location. Not shown when it doesn't already have one.", "Save"), buttonSize)) { theme->Save(theme->file_path); } } - if (ImGui::Button(_TR_CTX("Theme Editor > button. Opens the theme loading dialog for themes created or imported by the user.", "Load..."), buttonSize)) { + if (ImGui::Button(_TR_CTX("Theme Editor | button. Opens the theme loading dialog for themes created or imported by the user.", "Load..."), buttonSize)) { loadOpen = true; } ImGui::SameLine(); - if (ImGui::Button(_TR_CTX("Theme Editor > button. Opens the theme saving dialog for themes created or imported by the user.", "Save as..."), buttonSize)) { + if (ImGui::Button(_TR_CTX("Theme Editor | button. Opens the theme saving dialog for themes created or imported by the user.", "Save as..."), buttonSize)) { saveAsOpen = true; } // Simplified Settings (expose floating-pointer border sizes as boolean representing 0.0f or 1.0f) - if (ImGui::SliderFloat(_TR_CTX("Theme Editor > slider. Simplified frame rounding.", "Frame Rounding"), &style.FrameRounding, 0.0f, 12.0f, "%.0f")) + if (ImGui::SliderFloat(_TR_CTX("Theme Editor | slider. Simplified frame rounding.", "Frame Rounding"), &style.FrameRounding, 0.0f, 12.0f, "%.0f")) style.GrabRounding = style.FrameRounding; // Make GrabRounding always the same value as FrameRounding - { bool border = (style.WindowBorderSize > 0.0f); if (ImGui::Checkbox(_TR_CTX("Theme Editor > checkbox", "Window Border"), &border)) { style.WindowBorderSize = border ? 1.0f : 0.0f; } } + { bool border = (style.WindowBorderSize > 0.0f); if (ImGui::Checkbox(_TR_CTX("Theme Editor | checkbox", "Window Border"), &border)) { style.WindowBorderSize = border ? 1.0f : 0.0f; } } ImGui::SameLine(); - { bool border = (style.FrameBorderSize > 0.0f); if (ImGui::Checkbox(_TR_CTX("Theme Editor > checkbox", "Frame Border"), &border)) { style.FrameBorderSize = border ? 1.0f : 0.0f; } } + { bool border = (style.FrameBorderSize > 0.0f); if (ImGui::Checkbox(_TR_CTX("Theme Editor | checkbox", "Frame Border"), &border)) { style.FrameBorderSize = border ? 1.0f : 0.0f; } } ImGui::SameLine(); - { bool border = (style.PopupBorderSize > 0.0f); if (ImGui::Checkbox(_TR_CTX("Theme Editor > checkbox", "Popup Border"), &border)) { style.PopupBorderSize = border ? 1.0f : 0.0f; } } + { bool border = (style.PopupBorderSize > 0.0f); if (ImGui::Checkbox(_TR_CTX("Theme Editor | checkbox", "Popup Border"), &border)) { style.PopupBorderSize = border ? 1.0f : 0.0f; } } ImGui::Separator(); if (ImGui::BeginTabBar("##tabs", ImGuiTabBarFlags_None)) { - if (ImGui::BeginTabItem(_TR_CTX("Theme Editor > Tab label", "Strings"))) + if (ImGui::BeginTabItem(_TR_CTX("Theme Editor | Tab label", "Strings"))) { - ImGui::InputText(_TR_CTX("Theme Editor > Strings > Name input label", "Name"), &theme->strings["fallback"].name); - ImGui::InputText(_TR_CTX("Theme Editor > Strings > Description input label", "Description"), &theme->strings["fallback"].description); + ImGui::InputText(_TR_CTX("Theme Editor | Strings | Name input label", "Name"), &theme->strings["fallback"].name); + ImGui::InputText(_TR_CTX("Theme Editor | Strings | Description input label", "Description"), &theme->strings["fallback"].description); ImGui::EndTabItem(); } - if (ImGui::BeginTabItem(_TR_CTX("Theme Editor > Tab label", "Sizes"))) + if (ImGui::BeginTabItem(_TR_CTX("Theme Editor | Tab label", "Sizes"))) { - ImGui::SeparatorText(_TR_CTX("Theme Editor > Sizes > Section label", "Sizing")); - ImGui::SliderFloat2(_TR_CTX("Theme Editor > Sizes > Sizing > label of XY sliders", "Window Padding"), (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f"); - ImGui::SliderFloat2(_TR_CTX("Theme Editor > Sizes > Sizing > label of XY sliders", "Frame Padding"), (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f"); - ImGui::SliderFloat2(_TR_CTX("Theme Editor > Sizes > Sizing > label of XY sliders", "Cell Padding"), (float*)&style.CellPadding, 0.0f, 20.0f, "%.0f"); - ImGui::SliderFloat2(_TR_CTX("Theme Editor > Sizes > Sizing > label of XY sliders", "Item Spacing"), (float*)&style.ItemSpacing, 0.0f, 20.0f, "%.0f"); - ImGui::SliderFloat2(_TR_CTX("Theme Editor > Sizes > Sizing > label of XY sliders", "Inner Item Spacing"), (float*)&style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f"); - //ImGui::SliderFloat2(_TR_CTX("Theme Editor > Sizes > Sizing > label of XY sliders", "TouchExtraPadding", (float*)&style.TouchExtraPadding, 0.0f, 10.0f, "%.0f"); - //ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Sizing > slider label", "IndentSpacing", &style.IndentSpacing, 0.0f, 30.0f, "%.0f"); - ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Sizing > slider label", "Scrollbar Size"), &style.ScrollbarSize, 1.0f, 20.0f, "%.0f"); - ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Sizing > slider label", "Minimum Grabber Size"), &style.GrabMinSize, 1.0f, 20.0f, "%.0f"); - ImGui::SliderFloat2(_TR_CTX("Theme Editor > Sizes > Sizing > label of XY sliders", "Separator Text Padding"), (float*)&style.SeparatorTextPadding, 0.0f, 40.0f, "%.0f"); + ImGui::SeparatorText(_TR_CTX("Theme Editor | Sizes | Section label", "Sizing")); + ImGui::SliderFloat2(_TR_CTX("Theme Editor | Sizes | Sizing | label of XY sliders", "Window Padding"), (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f"); + ImGui::SliderFloat2(_TR_CTX("Theme Editor | Sizes | Sizing | label of XY sliders", "Frame Padding"), (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f"); + ImGui::SliderFloat2(_TR_CTX("Theme Editor | Sizes | Sizing | label of XY sliders", "Cell Padding"), (float*)&style.CellPadding, 0.0f, 20.0f, "%.0f"); + ImGui::SliderFloat2(_TR_CTX("Theme Editor | Sizes | Sizing | label of XY sliders", "Item Spacing"), (float*)&style.ItemSpacing, 0.0f, 20.0f, "%.0f"); + ImGui::SliderFloat2(_TR_CTX("Theme Editor | Sizes | Sizing | label of XY sliders", "Inner Item Spacing"), (float*)&style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f"); + //ImGui::SliderFloat2(_TR_CTX("Theme Editor | Sizes | Sizing | label of XY sliders", "TouchExtraPadding", (float*)&style.TouchExtraPadding, 0.0f, 10.0f, "%.0f"); + //ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Sizing | slider label", "IndentSpacing", &style.IndentSpacing, 0.0f, 30.0f, "%.0f"); + ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Sizing | slider label", "Scrollbar Size"), &style.ScrollbarSize, 1.0f, 20.0f, "%.0f"); + ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Sizing | slider label", "Minimum Grabber Size"), &style.GrabMinSize, 1.0f, 20.0f, "%.0f"); + ImGui::SliderFloat2(_TR_CTX("Theme Editor | Sizes | Sizing | label of XY sliders", "Separator Text Padding"), (float*)&style.SeparatorTextPadding, 0.0f, 40.0f, "%.0f"); - ImGui::SeparatorText(_TR_CTX("Theme Editor > Sizes > Section label", "Borders")); - ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Borders > slider label", "Window Border Size"), &style.WindowBorderSize, 0.0f, 1.0f, "%.0f"); - ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Borders > slider label", "Child Border Size"), &style.ChildBorderSize, 0.0f, 1.0f, "%.0f"); - ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Borders > slider label", "Popup Border Size"), &style.PopupBorderSize, 0.0f, 1.0f, "%.0f"); - ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Borders > slider label", "Frame Border Size"), &style.FrameBorderSize, 0.0f, 1.0f, "%.0f"); - ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Borders > slider label", "Tab Border Size"), &style.TabBorderSize, 0.0f, 1.0f, "%.0f"); - ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Borders > slider label", "Separator Text Border Size"), &style.SeparatorTextBorderSize, 0.0f, 10.0f, "%.0f"); + ImGui::SeparatorText(_TR_CTX("Theme Editor | Sizes | Section label", "Borders")); + ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Borders | slider label", "Window Border Size"), &style.WindowBorderSize, 0.0f, 1.0f, "%.0f"); + ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Borders | slider label", "Child Border Size"), &style.ChildBorderSize, 0.0f, 1.0f, "%.0f"); + ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Borders | slider label", "Popup Border Size"), &style.PopupBorderSize, 0.0f, 1.0f, "%.0f"); + ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Borders | slider label", "Frame Border Size"), &style.FrameBorderSize, 0.0f, 1.0f, "%.0f"); + ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Borders | slider label", "Tab Border Size"), &style.TabBorderSize, 0.0f, 1.0f, "%.0f"); + ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Borders | slider label", "Separator Text Border Size"), &style.SeparatorTextBorderSize, 0.0f, 10.0f, "%.0f"); - ImGui::SeparatorText(_TR_CTX("Theme Editor > Sizes > Section label", "Rounding")); - ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Rounding > slider label", "Window Rounding"), &style.WindowRounding, 0.0f, 12.0f, "%.0f"); - ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Rounding > slider label", "Child Rounding"), &style.ChildRounding, 0.0f, 12.0f, "%.0f"); - ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Rounding > slider label", "Frame Rounding"), &style.FrameRounding, 0.0f, 12.0f, "%.0f"); - ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Rounding > slider label", "Popup Rounding"), &style.PopupRounding, 0.0f, 12.0f, "%.0f"); - ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Rounding > slider label", "Scrollbar Rounding"), &style.ScrollbarRounding, 0.0f, 12.0f, "%.0f"); - ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Rounding > slider label", "Grabber Rounding"), &style.GrabRounding, 0.0f, 12.0f, "%.0f"); - ImGui::SliderFloat(_TR_CTX("Theme Editor > Sizes > Rounding > slider label", "Tab Rounding"), &style.TabRounding, 0.0f, 12.0f, "%.0f"); + ImGui::SeparatorText(_TR_CTX("Theme Editor | Sizes | Section label", "Rounding")); + ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Rounding | slider label", "Window Rounding"), &style.WindowRounding, 0.0f, 12.0f, "%.0f"); + ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Rounding | slider label", "Child Rounding"), &style.ChildRounding, 0.0f, 12.0f, "%.0f"); + ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Rounding | slider label", "Frame Rounding"), &style.FrameRounding, 0.0f, 12.0f, "%.0f"); + ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Rounding | slider label", "Popup Rounding"), &style.PopupRounding, 0.0f, 12.0f, "%.0f"); + ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Rounding | slider label", "Scrollbar Rounding"), &style.ScrollbarRounding, 0.0f, 12.0f, "%.0f"); + ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Rounding | slider label", "Grabber Rounding"), &style.GrabRounding, 0.0f, 12.0f, "%.0f"); + ImGui::SliderFloat(_TR_CTX("Theme Editor | Sizes | Rounding | slider label", "Tab Rounding"), &style.TabRounding, 0.0f, 12.0f, "%.0f"); ImGui::EndTabItem(); } - if (ImGui::BeginTabItem(_TR_CTX("Theme Editor > Tab label", "Colors"))) + if (ImGui::BeginTabItem(_TR_CTX("Theme Editor | Tab label", "Colors"))) { static ImGuiTextFilter filter; - filter.Draw(_TR_CTX("Theme Editor > Colors > text filter", "Filter colors"), ImGui::GetFontSize() * 16); + filter.Draw(_TR_CTX("Theme Editor | Colors | text filter", "Filter colors"), ImGui::GetFontSize() * 16); static ImGuiColorEditFlags alpha_flags = 0; - if (ImGui::RadioButton(_TR_CTX("Theme Editor > Colors > preview settings radio button", "Opaque"), alpha_flags == ImGuiColorEditFlags_None)) { alpha_flags = ImGuiColorEditFlags_None; } ImGui::SameLine(); - if (ImGui::RadioButton(_TR_CTX("Theme Editor > Colors > preview settings radio button", "Alpha"), alpha_flags == ImGuiColorEditFlags_AlphaPreview)) { alpha_flags = ImGuiColorEditFlags_AlphaPreview; } ImGui::SameLine(); - if (ImGui::RadioButton(_TR_CTX("Theme Editor > Colors > preview settings radio button", "Both"), alpha_flags == ImGuiColorEditFlags_AlphaPreviewHalf)) { alpha_flags = ImGuiColorEditFlags_AlphaPreviewHalf; } + if (ImGui::RadioButton(_TR_CTX("Theme Editor | Colors | preview settings radio button", "Opaque"), alpha_flags == ImGuiColorEditFlags_None)) { alpha_flags = ImGuiColorEditFlags_None; } ImGui::SameLine(); + if (ImGui::RadioButton(_TR_CTX("Theme Editor | Colors | preview settings radio button", "Alpha"), alpha_flags == ImGuiColorEditFlags_AlphaPreview)) { alpha_flags = ImGuiColorEditFlags_AlphaPreview; } ImGui::SameLine(); + if (ImGui::RadioButton(_TR_CTX("Theme Editor | Colors | preview settings radio button", "Both"), alpha_flags == ImGuiColorEditFlags_AlphaPreviewHalf)) { alpha_flags = ImGuiColorEditFlags_AlphaPreviewHalf; } ImGui::BeginChild("##colors", ImVec2(0, 0), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NavFlattened); ImGui::PushItemWidth(-160); @@ -190,7 +190,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid continue; ImGui::PushID(i); bool hueEnabled = theme->HueEnabledColors.contains(i); - if (ImGui::Checkbox(_TR_CTX("Theme Editor > Colors > (Any color) > recoloring checkbox", "Match hue preference"), &hueEnabled)) { + if (ImGui::Checkbox(_TR_CTX("Theme Editor | Colors | (Any color) | recoloring checkbox", "Match hue preference"), &hueEnabled)) { if (hueEnabled) { theme->HueEnabledColors.insert(i); } else { @@ -227,16 +227,16 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid exportDialog.ClearSelected(); } if (loadOpen) { - ImGui::OpenPopup(_TR_CTX("Theme Editor > Custom modal dialog title", "Load...")); + ImGui::OpenPopup(_TR_CTX("Theme Editor | Custom modal dialog title", "Load...")); ImGui::SetNextWindowPos(ImVec2(0, 0)); ImGui::SetNextWindowSize(ImVec2(window_width, window_height)); - if (ImGui::BeginPopupModal(_TR_CTX("Theme Editor > Custom modal dialog title", "Load..."), nullptr, ImGuiWindowFlags_Modal|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize)) { + if (ImGui::BeginPopupModal(_TR_CTX("Theme Editor | Custom modal dialog title", "Load..."), nullptr, ImGuiWindowFlags_Modal|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize)) { static path selectedThemePath; static string filter = ""; - ImGui::Text(_TR_CTX("Theme Editor > Load dialog > Theme selector > filter label", "Filter:")); ImGui::SameLine(); + ImGui::Text(_TR_CTX("Theme Editor | Load dialog | Theme selector | filter label", "Filter:")); ImGui::SameLine(); ImGui::SetNextItemWidth(ImGui::GetWindowWidth() - ImGui::GetCursorPosX() - ImGui::GetStyle().WindowPadding.x); ImGui::InputText("##FilterInput", &filter); - ImGui::Text(_TR_CTX("Theme Editor > Load dialog > Theme selector > label", "Available themes...")); + ImGui::Text(_TR_CTX("Theme Editor | Load dialog | Theme selector | label", "Available themes...")); if (ImGui::BeginListBox("##Themes", ImVec2(ImGui::GetWindowWidth() - (ImGui::GetStyle().WindowPadding.x * 2.0f), -ImGui::GetTextLineHeightWithSpacing() - ImGui::GetStyle().WindowPadding.y))) { for (auto themePath : Theme::availableThemes) { string themeStem = themePath.stem().string(); @@ -252,7 +252,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid } ImGui::EndListBox(); } - if (ImGui::Button(_TR_CTX("Theme Editor > Load dialog > Load button", "Load"))) { + if (ImGui::Button(_TR_CTX("Theme Editor | Load dialog | Load button", "Load"))) { if (!selectedThemePath.empty()) { filter = ""; loadOpen = false; @@ -264,7 +264,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid } } ImGui::SameLine(); - if (ImGui::Button(_TR_CTX("Theme Editor > Load dialog > Cancel button", "Cancel"))) { + if (ImGui::Button(_TR_CTX("Theme Editor | Load dialog | Cancel button", "Cancel"))) { selectedThemePath = path(); filter = ""; loadOpen = false; @@ -273,16 +273,16 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid } } if (saveAsOpen) { - ImGui::OpenPopup(_TR_CTX("Theme Editor > Custom modal dialog title", "Save as...")); + ImGui::OpenPopup(_TR_CTX("Theme Editor | Custom modal dialog title", "Save as...")); ImGui::SetNextWindowPos(ImVec2(0, 0)); ImGui::SetNextWindowSize(ImVec2(window_width, window_height)); - if (ImGui::BeginPopupModal(_TR_CTX("Theme Editor > Custom modal dialog title", "Save as..."), nullptr, ImGuiWindowFlags_Modal|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize)) { + if (ImGui::BeginPopupModal(_TR_CTX("Theme Editor | Custom modal dialog title", "Save as..."), nullptr, ImGuiWindowFlags_Modal|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize)) { static string selectedThemeName = ""; static string filter = ""; - ImGui::Text(_TR_CTX("Theme Editor > Save as dialog > Theme selector > filter label", "Filter:")); ImGui::SameLine(); + ImGui::Text(_TR_CTX("Theme Editor | Save as dialog | Theme selector | filter label", "Filter:")); ImGui::SameLine(); ImGui::SetNextItemWidth(ImGui::GetWindowWidth() - ImGui::GetCursorPosX() - ImGui::GetStyle().WindowPadding.x); ImGui::InputText("##FilterInput", &filter, 1024); - ImGui::Text(_TR_CTX("Theme Editor > Save as dialog > Theme selector > label", "Available themes...")); + ImGui::Text(_TR_CTX("Theme Editor | Save as dialog | Theme selector | label", "Available themes...")); if (ImGui::BeginListBox("##Themes", ImVec2(ImGui::GetWindowWidth() - (ImGui::GetStyle().WindowPadding.x * 2.0f), -ImGui::GetFrameHeightWithSpacing() - ImGui::GetTextLineHeightWithSpacing() - ImGui::GetStyle().WindowPadding.y))) { for (auto themePath : Theme::availableThemes) { string themeStem = themePath.stem().string(); @@ -299,8 +299,8 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid ImGui::EndListBox(); } ImGui::SetNextItemWidth(ImGui::GetWindowWidth() - (ImGui::GetStyle().WindowPadding.x * 2.0f)); - ImGui::InputText(_TR_CTX("Theme Editor > Save as dialog > Theme name input label", "Theme name: "), &selectedThemeName); - if (ImGui::Button(_TR_CTX("Theme Editor > Save as dialog > Save button", "Save"))) { + ImGui::InputText(_TR_CTX("Theme Editor | Save as dialog | Theme name input label", "Theme name: "), &selectedThemeName); + if (ImGui::Button(_TR_CTX("Theme Editor | Save as dialog | Save button", "Save"))) { path selectedThemePath(selectedThemeName); if (!selectedThemePath.empty() && !selectedThemePath.is_absolute()) { selectedThemeName = ""; @@ -311,7 +311,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid } } ImGui::SameLine(); - if (ImGui::Button(_TR_CTX("Theme Editor > Save as dialog > Cancel button", "Cancel"))) { + if (ImGui::Button(_TR_CTX("Theme Editor | Save as dialog | Cancel button", "Cancel"))) { selectedThemeName = ""; filter = ""; saveAsOpen = false; @@ -470,8 +470,8 @@ Theme::Theme(bool dark) : Theme() { style.WindowRounding = 12; } ThemeStrings::ThemeStrings() { - name = _TRS_CTX("Theme default strings > name", "A theme"); - description = _TRS_CTX("Theme default strings > description", "(No description)"); + name = _TRS_CTX("Theme default strings | name", "A theme"); + description = _TRS_CTX("Theme default strings | description", "(No description)"); } ThemeStrings Theme::GetStrings() { char *language_c = CURRENT_LANGUAGE; diff --git a/translation.h b/translation.h index 531a37b..a4b73be 100644 --- a/translation.h +++ b/translation.h @@ -2,11 +2,11 @@ #include #include #include -// Based on the code found in gettext.h, but without any additionall things we don't need. +// Based on the code found in gettext.h, but without any additional things we don't need. inline static const char *gettext_ctx(const char *ctx, const char *msgid) { - const char *msg_ctxt_id = (std::string(ctx) + std::string("\004") + std::string(msgid)).c_str(); - const char *translation = gettext(msg_ctxt_id); - if (translation == msg_ctxt_id) { + std::string msg_ctxt_id = (std::string(ctx) + std::string("\004") + std::string(msgid)); + const char *translation = gettext(msg_ctxt_id.c_str()); + if (std::string(translation) == msg_ctxt_id) { return msgid; } else { return translation; @@ -20,4 +20,7 @@ inline static const char *gettext_ctx(const char *ctx, const char *msgid) { #define _TRI(icon, str) _TRIS(icon, str).c_str() #define _TRIS_CTX(icon, ctx, str) (std::string(icon) + _TRS_CTX(ctx, str)) #define _TRI_CTX(icon, ctx, str) _TRIS_CTX(icon, ctx, str).c_str() -#define CURRENT_LANGUAGE textdomain(NULL) \ No newline at end of file +#define CURRENT_LANGUAGE setlocale(LC_MESSAGES, NULL) +// The value required to set the operating system's default language. +#define DEFAULT_LANG "" +#define SET_LANG(lang) setlocale(LC_MESSAGES, lang) \ No newline at end of file