Update translations and improve support

This commit is contained in:
Zachary Hall 2023-07-25 14:33:29 -07:00
parent 6947dc65f6
commit e3fff57fed
8 changed files with 875 additions and 243 deletions

Binary file not shown.

View file

@ -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 <EMAIL@ADDRESS>, 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 "(説明なし)"

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Neko Player\n" "Project-Id-Version: Neko Player\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: None\n" "Language-Team: None\n"
@ -21,224 +21,234 @@ msgstr ""
"X-Poedit-SearchPath-0: theme.cpp\n" "X-Poedit-SearchPath-0: theme.cpp\n"
"X-Poedit-SearchPath-1: main.cpp\n" "X-Poedit-SearchPath-1: main.cpp\n"
#: main.cpp:227 #: main.cpp:120
msgctxt "File dialog title" msgctxt "Language name"
msgid "Open..." msgid "English (United States)"
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"
msgstr "" msgstr ""
#: main.cpp:292 #: 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" msgid "Default dark"
msgstr "" msgstr ""
#: main.cpp:356 #: main.cpp:368
msgctxt "Main menu" msgctxt "Main menu"
msgid "File" msgid "File"
msgstr "" msgstr ""
#: main.cpp:357 #: main.cpp:369
msgctxt "Main menu > File" msgctxt "Main menu | File"
msgid "Open" msgid "Open"
msgstr "" msgstr ""
#: main.cpp:360 #: main.cpp:371
msgctxt "Main menu > File" 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" msgid "Quit"
msgstr "" msgstr ""
#: main.cpp:365 #: main.cpp:380
msgctxt "Main menu" msgctxt "Main menu"
msgid "Edit" msgid "Edit"
msgstr "" msgstr ""
#: main.cpp:366 #: main.cpp:381
msgctxt "Main menu > Edit" msgctxt "Main menu | Edit"
msgid "Preferences..." msgid "Preferences..."
msgstr "" msgstr ""
#: main.cpp:372 #: main.cpp:387
msgctxt "Main menu (in debug builds)" msgctxt "Main menu (in debug builds)"
msgid "Debug" msgid "Debug"
msgstr "" msgstr ""
#: main.cpp:373 #: main.cpp:388
msgctxt "Main menu > Debug" msgctxt "Main menu | Debug"
msgid "Show ImGui Demo Window" msgid "Show ImGui Demo Window"
msgstr "" msgstr ""
#: main.cpp:379 #: main.cpp:394
msgctxt "Main menu" msgctxt "Main menu"
msgid "Help" msgid "Help"
msgstr "" msgstr ""
#: main.cpp:380 #: main.cpp:395
msgctxt "Main menu > Help" msgctxt "Main menu | Help"
msgid "About" msgid "About"
msgstr "" msgstr ""
#: main.cpp:388 #: main.cpp:403
msgctxt "Main window title" msgctxt "Main window title"
msgid "Player" msgid "Player"
msgstr "" msgstr ""
#: main.cpp:417 #: main.cpp:432
#, c-format #, c-format
msgctxt "Playback controls > slider" msgctxt "Playback controls | slider"
msgid "Speed: %.2fx" msgid "Speed: %.2fx"
msgstr "" msgstr ""
#: main.cpp:421 #: main.cpp:436
#, c-format #, c-format
msgctxt "Playback controls > slider" msgctxt "Playback controls | slider"
msgid "Tempo: %.2fx" msgid "Tempo: %.2fx"
msgstr "" 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 #: main.cpp:440
#, c-format #, c-format
msgctxt "Preferences > Framerate slider" msgctxt "Playback controls | slider"
msgid "Max framerate without VSync: %d" msgid "Pitch: %.2fx"
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:"
msgstr "" msgstr ""
#: main.cpp:448 #: 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..." msgid "Select a theme..."
msgstr "" msgstr ""
#: main.cpp:485 #: main.cpp:516
#, c-format #, 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°" msgid "Accent color hue: %.0f°"
msgstr "" msgstr ""
#: main.cpp:493 #: main.cpp:524
msgctxt "Window title, window opened by menu item" msgctxt "Window title, window opened by menu item"
msgid "About and Licenses" msgid "About and Licenses"
msgstr "" msgstr ""
#: main.cpp:495 #: main.cpp:526
msgctxt "Application name - Japanese word should remain Japanese and stay the same when translating for stylistic purposes." msgctxt "Application name - Japanese word should remain Japanese and stay the same when translating for stylistic purposes."
msgid "ねこ Player" msgid "ねこ Player"
msgstr "" msgstr ""
#: main.cpp:499 #: main.cpp:530
msgctxt "Application name - Japanese word should be converted to the translated language's characters. Use an empty string to disable for Japanese." 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)" msgid "(Neko Player)"
msgstr "" msgstr ""
#: main.cpp:504 #: main.cpp:535
msgctxt "Version string format specifier" msgctxt "Version string format specifier"
msgid "Version " msgid "Version "
msgstr "" msgstr ""
#: main.cpp:504 #: main.cpp:535
msgctxt "Suffix to the version string in the about window, if needed" msgctxt "Suffix to the version string in the about window, if needed"
msgid " " msgid " "
msgstr "" msgstr ""
#: main.cpp:510 #: main.cpp:541
msgctxt "Library name" msgctxt "Library name"
msgid "SDL Mixer X" msgid "SDL Mixer X"
msgstr "" msgstr ""
#: main.cpp:511 #: main.cpp:542
msgctxt "Library name" msgctxt "Library name"
msgid "JsonCpp" msgid "JsonCpp"
msgstr "" msgstr ""
#: main.cpp:512 #: main.cpp:543
msgctxt "Library name" msgctxt "Library name"
msgid "SoundTouch" msgid "SoundTouch"
msgstr "" msgstr ""
#: main.cpp:513 #: main.cpp:544
msgctxt "Library name" msgctxt "Library name"
msgid "libintl" msgid "libintl"
msgstr "" msgstr ""
#: main.cpp:514 #: main.cpp:545
msgctxt "Library name" msgctxt "Library name"
msgid "Dear ImGui" msgid "Dear ImGui"
msgstr "" msgstr ""
#: main.cpp:515 #: main.cpp:546
msgctxt "Library name" msgctxt "Library name"
msgid "imgui-filebrowser" msgid "imgui-filebrowser"
msgstr "" msgstr ""
#: main.cpp:517 #: main.cpp:548
msgctxt "Library name" msgctxt "Library name"
msgid "libportal" msgid "libportal"
msgstr "" msgstr ""
#: main.cpp:519 #: main.cpp:550
msgctxt "Library name" msgctxt "Library name"
msgid "Noto Sans" msgid "Noto Sans"
msgstr "" msgstr ""
#: main.cpp:520 #: main.cpp:551
msgctxt "Library name" msgctxt "Library name"
msgid "Fork Awesome" msgid "Fork Awesome"
msgstr "" msgstr ""
#: main.cpp:521 #: main.cpp:552
msgctxt "Library name" msgctxt "Library name"
msgid "IconFontCppHeaders" msgid "IconFontCppHeaders"
msgstr "" msgstr ""
#: main.cpp:546 #: main.cpp:577
msgctxt "Project selector label." msgctxt "Project selector label."
msgid "Project" msgid "Project"
msgstr "" msgstr ""
#: main.cpp:561 #: main.cpp:592
msgctxt "License viewer label" msgctxt "License viewer label"
msgid "License" msgid "License"
msgstr "" msgstr ""
#: main.cpp:564 #: main.cpp:595
#, c-format #, 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" msgid "%s: %s"
msgstr "" msgstr ""
@ -248,17 +258,17 @@ msgid "Theme Editor"
msgstr "" msgstr ""
#: theme.cpp:43 #: theme.cpp:43
msgctxt "Theme Editor > preset button" msgctxt "Theme Editor | preset button"
msgid "Create light" msgid "Create light"
msgstr "" msgstr ""
#: theme.cpp:52 #: theme.cpp:52
msgctxt "Theme Editor > preset button" msgctxt "Theme Editor | preset button"
msgid "Create dark" msgid "Create dark"
msgstr "" msgstr ""
#: theme.cpp:60 #: 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..." msgid "Import..."
msgstr "" msgstr ""
@ -273,7 +283,7 @@ msgid "Theme JSON files"
msgstr "" msgstr ""
#: theme.cpp:74 #: 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..." msgid "Export..."
msgstr "" msgstr ""
@ -283,276 +293,276 @@ msgid "Export theme..."
msgstr "" msgstr ""
#: theme.cpp:98 #: theme.cpp:98
msgctxt "Theme Editor > button. Reverts to saved file." msgctxt "Theme Editor | button. Reverts to saved file."
msgid "Revert" msgid "Revert"
msgstr "" msgstr ""
#: theme.cpp:107 #: 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" msgid "Save"
msgstr "" msgstr ""
#: theme.cpp:111 #: 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..." msgid "Load..."
msgstr "" msgstr ""
#: theme.cpp:115 #: 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..." msgid "Save as..."
msgstr "" msgstr ""
#: theme.cpp:120 #: theme.cpp:120
msgctxt "Theme Editor > slider. Simplified frame rounding." msgctxt "Theme Editor | slider. Simplified frame rounding."
msgid "Frame Rounding" msgid "Frame Rounding"
msgstr "" msgstr ""
#: theme.cpp:122 #: theme.cpp:122
msgctxt "Theme Editor > checkbox" msgctxt "Theme Editor | checkbox"
msgid "Window Border" msgid "Window Border"
msgstr "" msgstr ""
#: theme.cpp:124 #: theme.cpp:124
msgctxt "Theme Editor > checkbox" msgctxt "Theme Editor | checkbox"
msgid "Frame Border" msgid "Frame Border"
msgstr "" msgstr ""
#: theme.cpp:126 #: theme.cpp:126
msgctxt "Theme Editor > checkbox" msgctxt "Theme Editor | checkbox"
msgid "Popup Border" msgid "Popup Border"
msgstr "" msgstr ""
#: theme.cpp:132 #: theme.cpp:132
msgctxt "Theme Editor > Tab label" msgctxt "Theme Editor | Tab label"
msgid "Strings" msgid "Strings"
msgstr "" msgstr ""
#: theme.cpp:134 #: theme.cpp:134
msgctxt "Theme Editor > Strings > Name input label" msgctxt "Theme Editor | Strings | Name input label"
msgid "Name" msgid "Name"
msgstr "" msgstr ""
#: theme.cpp:135 #: theme.cpp:135
msgctxt "Theme Editor > Strings > Description input label" msgctxt "Theme Editor | Strings | Description input label"
msgid "Description" msgid "Description"
msgstr "" msgstr ""
#: theme.cpp:139 #: theme.cpp:139
msgctxt "Theme Editor > Tab label" msgctxt "Theme Editor | Tab label"
msgid "Sizes" msgid "Sizes"
msgstr "" msgstr ""
#: theme.cpp:141 #: theme.cpp:141
msgctxt "Theme Editor > Sizes > Section label" msgctxt "Theme Editor | Sizes | Section label"
msgid "Sizing" msgid "Sizing"
msgstr "" msgstr ""
#: theme.cpp:142 #: theme.cpp:142
msgctxt "Theme Editor > Sizes > Sizing > label of XY sliders" msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders"
msgid "Window Padding" msgid "Window Padding"
msgstr "" msgstr ""
#: theme.cpp:143 #: theme.cpp:143
msgctxt "Theme Editor > Sizes > Sizing > label of XY sliders" msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders"
msgid "Frame Padding" msgid "Frame Padding"
msgstr "" msgstr ""
#: theme.cpp:144 #: theme.cpp:144
msgctxt "Theme Editor > Sizes > Sizing > label of XY sliders" msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders"
msgid "Cell Padding" msgid "Cell Padding"
msgstr "" msgstr ""
#: theme.cpp:145 #: theme.cpp:145
msgctxt "Theme Editor > Sizes > Sizing > label of XY sliders" msgctxt "Theme Editor | Sizes | Sizing | label of XY sliders"
msgid "Item Spacing" msgid "Item Spacing"
msgstr "" msgstr ""
#: theme.cpp:146 #: 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" msgid "Inner Item Spacing"
msgstr "" msgstr ""
#: theme.cpp:149 #: theme.cpp:149
msgctxt "Theme Editor > Sizes > Sizing > slider label" msgctxt "Theme Editor | Sizes | Sizing | slider label"
msgid "Scrollbar Size" msgid "Scrollbar Size"
msgstr "" msgstr ""
#: theme.cpp:150 #: theme.cpp:150
msgctxt "Theme Editor > Sizes > Sizing > slider label" msgctxt "Theme Editor | Sizes | Sizing | slider label"
msgid "Minimum Grabber Size" msgid "Minimum Grabber Size"
msgstr "" msgstr ""
#: theme.cpp:151 #: 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" msgid "Separator Text Padding"
msgstr "" msgstr ""
#: theme.cpp:153 #: theme.cpp:153
msgctxt "Theme Editor > Sizes > Section label" msgctxt "Theme Editor | Sizes | Section label"
msgid "Borders" msgid "Borders"
msgstr "" msgstr ""
#: theme.cpp:154 #: theme.cpp:154
msgctxt "Theme Editor > Sizes > Borders > slider label" msgctxt "Theme Editor | Sizes | Borders | slider label"
msgid "Window Border Size" msgid "Window Border Size"
msgstr "" msgstr ""
#: theme.cpp:155 #: theme.cpp:155
msgctxt "Theme Editor > Sizes > Borders > slider label" msgctxt "Theme Editor | Sizes | Borders | slider label"
msgid "Child Border Size" msgid "Child Border Size"
msgstr "" msgstr ""
#: theme.cpp:156 #: theme.cpp:156
msgctxt "Theme Editor > Sizes > Borders > slider label" msgctxt "Theme Editor | Sizes | Borders | slider label"
msgid "Popup Border Size" msgid "Popup Border Size"
msgstr "" msgstr ""
#: theme.cpp:157 #: theme.cpp:157
msgctxt "Theme Editor > Sizes > Borders > slider label" msgctxt "Theme Editor | Sizes | Borders | slider label"
msgid "Frame Border Size" msgid "Frame Border Size"
msgstr "" msgstr ""
#: theme.cpp:158 #: theme.cpp:158
msgctxt "Theme Editor > Sizes > Borders > slider label" msgctxt "Theme Editor | Sizes | Borders | slider label"
msgid "Tab Border Size" msgid "Tab Border Size"
msgstr "" msgstr ""
#: theme.cpp:159 #: theme.cpp:159
msgctxt "Theme Editor > Sizes > Borders > slider label" msgctxt "Theme Editor | Sizes | Borders | slider label"
msgid "Separator Text Border Size" msgid "Separator Text Border Size"
msgstr "" msgstr ""
#: theme.cpp:161 #: theme.cpp:161
msgctxt "Theme Editor > Sizes > Section label" msgctxt "Theme Editor | Sizes | Section label"
msgid "Rounding" msgid "Rounding"
msgstr "" msgstr ""
#: theme.cpp:162 #: theme.cpp:162
msgctxt "Theme Editor > Sizes > Rounding > slider label" msgctxt "Theme Editor | Sizes | Rounding | slider label"
msgid "Window Rounding" msgid "Window Rounding"
msgstr "" msgstr ""
#: theme.cpp:163 #: theme.cpp:163
msgctxt "Theme Editor > Sizes > Rounding > slider label" msgctxt "Theme Editor | Sizes | Rounding | slider label"
msgid "Child Rounding" msgid "Child Rounding"
msgstr "" msgstr ""
#: theme.cpp:164 #: theme.cpp:164
msgctxt "Theme Editor > Sizes > Rounding > slider label" msgctxt "Theme Editor | Sizes | Rounding | slider label"
msgid "Frame Rounding" msgid "Frame Rounding"
msgstr "" msgstr ""
#: theme.cpp:165 #: theme.cpp:165
msgctxt "Theme Editor > Sizes > Rounding > slider label" msgctxt "Theme Editor | Sizes | Rounding | slider label"
msgid "Popup Rounding" msgid "Popup Rounding"
msgstr "" msgstr ""
#: theme.cpp:166 #: theme.cpp:166
msgctxt "Theme Editor > Sizes > Rounding > slider label" msgctxt "Theme Editor | Sizes | Rounding | slider label"
msgid "Scrollbar Rounding" msgid "Scrollbar Rounding"
msgstr "" msgstr ""
#: theme.cpp:167 #: theme.cpp:167
msgctxt "Theme Editor > Sizes > Rounding > slider label" msgctxt "Theme Editor | Sizes | Rounding | slider label"
msgid "Grabber Rounding" msgid "Grabber Rounding"
msgstr "" msgstr ""
#: theme.cpp:168 #: theme.cpp:168
msgctxt "Theme Editor > Sizes > Rounding > slider label" msgctxt "Theme Editor | Sizes | Rounding | slider label"
msgid "Tab Rounding" msgid "Tab Rounding"
msgstr "" msgstr ""
#: theme.cpp:173 #: theme.cpp:173
msgctxt "Theme Editor > Tab label" msgctxt "Theme Editor | Tab label"
msgid "Colors" msgid "Colors"
msgstr "" msgstr ""
#: theme.cpp:177 #: theme.cpp:177
msgctxt "Theme Editor > Colors > text filter" msgctxt "Theme Editor | Colors | text filter"
msgid "Filter colors" msgid "Filter colors"
msgstr "" msgstr ""
#: theme.cpp:180 #: theme.cpp:180
msgctxt "Theme Editor > Colors > preview settings radio button" msgctxt "Theme Editor | Colors | preview settings radio button"
msgid "Opaque" msgid "Opaque"
msgstr "" msgstr ""
#: theme.cpp:181 #: theme.cpp:181
msgctxt "Theme Editor > Colors > preview settings radio button" msgctxt "Theme Editor | Colors | preview settings radio button"
msgid "Alpha" msgid "Alpha"
msgstr "" msgstr ""
#: theme.cpp:182 #: theme.cpp:182
msgctxt "Theme Editor > Colors > preview settings radio button" msgctxt "Theme Editor | Colors | preview settings radio button"
msgid "Both" msgid "Both"
msgstr "" msgstr ""
#: theme.cpp:193 #: theme.cpp:193
msgctxt "Theme Editor > Colors > (Any color) > recoloring checkbox" msgctxt "Theme Editor | Colors | (Any color) | recoloring checkbox"
msgid "Match hue preference" msgid "Match hue preference"
msgstr "" msgstr ""
#: theme.cpp:230 theme.cpp:233 #: theme.cpp:230 theme.cpp:233
msgctxt "Theme Editor > Custom modal dialog title" msgctxt "Theme Editor | Custom modal dialog title"
msgid "Load..." msgid "Load..."
msgstr "" msgstr ""
#: theme.cpp:236 #: theme.cpp:236
msgctxt "Theme Editor > Load dialog > Theme selector > filter label" msgctxt "Theme Editor | Load dialog | Theme selector | filter label"
msgid "Filter:" msgid "Filter:"
msgstr "" msgstr ""
#: theme.cpp:239 #: theme.cpp:239
msgctxt "Theme Editor > Load dialog > Theme selector > label" msgctxt "Theme Editor | Load dialog | Theme selector | label"
msgid "Available themes..." msgid "Available themes..."
msgstr "" msgstr ""
#: theme.cpp:255 #: theme.cpp:255
msgctxt "Theme Editor > Load dialog > Load button" msgctxt "Theme Editor | Load dialog | Load button"
msgid "Load" msgid "Load"
msgstr "" msgstr ""
#: theme.cpp:267 #: theme.cpp:267
msgctxt "Theme Editor > Load dialog > Cancel button" msgctxt "Theme Editor | Load dialog | Cancel button"
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: theme.cpp:276 theme.cpp:279 #: theme.cpp:276 theme.cpp:279
msgctxt "Theme Editor > Custom modal dialog title" msgctxt "Theme Editor | Custom modal dialog title"
msgid "Save as..." msgid "Save as..."
msgstr "" msgstr ""
#: theme.cpp:282 #: 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:" msgid "Filter:"
msgstr "" msgstr ""
#: theme.cpp:285 #: theme.cpp:285
msgctxt "Theme Editor > Save as dialog > Theme selector > label" msgctxt "Theme Editor | Save as dialog | Theme selector | label"
msgid "Available themes..." msgid "Available themes..."
msgstr "" msgstr ""
#: theme.cpp:302 #: 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: " msgid "Theme name: "
msgstr "" msgstr ""
#: theme.cpp:303 #: theme.cpp:303
msgctxt "Theme Editor > Save as dialog > Save button" msgctxt "Theme Editor | Save as dialog | Save button"
msgid "Save" msgid "Save"
msgstr "" msgstr ""
#: theme.cpp:314 #: theme.cpp:314
msgctxt "Theme Editor > Save as dialog > Cancel button" msgctxt "Theme Editor | Save as dialog | Cancel button"
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: theme.cpp:473 #: theme.cpp:473
msgctxt "Theme default strings > name" msgctxt "Theme default strings | name"
msgid "A theme" msgid "A theme"
msgstr "" msgstr ""
#: theme.cpp:474 #: theme.cpp:474
msgctxt "Theme default strings > description" msgctxt "Theme default strings | description"
msgid "(No description)" msgid "(No description)"
msgstr "" msgstr ""

View file

@ -1,3 +0,0 @@
#!/bin/sh
./build-file.sh
flatpak install --reinstall -y --user --noninteractive ./neko-player.flatpak

View file

@ -113,7 +113,11 @@ ImFont *add_font(vector<FontData> data_vec, int size = 13) {
// Main code // Main code
int main(int, char**) int main(int, char**)
{ {
setlocale(LC_ALL, "");
bindtextdomain("neko_player", LOCALE_DIR); 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 #ifdef PORTALS
g_set_application_name("Neko Player"); g_set_application_name("Neko Player");
#endif #endif
@ -224,8 +228,6 @@ int main(int, char**)
ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f); ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
FileBrowser fileDialog(false, ImGuiFileBrowserFlags_NoTitleBar|ImGuiFileBrowserFlags_NoMove|ImGuiFileBrowserFlags_NoResize); 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( std::string userdir = std::getenv(
#ifdef _WIN32 #ifdef _WIN32
"UserProfile" "UserProfile"
@ -246,6 +248,7 @@ int main(int, char**)
bool stopped = true; bool stopped = true;
bool vsync = false; bool vsync = false;
bool about_window = false; bool about_window = false;
string lang;
int framerate = 60; int framerate = 60;
{ {
Json::Value config; Json::Value config;
@ -272,16 +275,25 @@ int main(int, char**)
if (config.isMember("framerate")) { if (config.isMember("framerate")) {
framerate = config["framerate"].asUInt(); 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(); stream.close();
} }
if (is_empty(Theme::themeDir)) { if (is_empty(Theme::themeDir)) {
path lightPath = Theme::themeDir / "light.json"; path lightPath = Theme::themeDir / "light.json";
path darkPath = Theme::themeDir / "dark.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)) { if (!exists(lightPath)) {
Theme light(false); Theme light(false);
ThemeStrings &strings = light.strings["fallback"]; 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; strings.description = builtinDescription;
light.strings[CURRENT_LANGUAGE] = strings; light.strings[CURRENT_LANGUAGE] = strings;
light.Save(lightPath); light.Save(lightPath);
@ -289,7 +301,7 @@ int main(int, char**)
if (!exists(darkPath)) { if (!exists(darkPath)) {
Theme dark(true); Theme dark(true);
ThemeStrings &strings = dark.strings["fallback"]; 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; strings.description = builtinDescription;
dark.strings[CURRENT_LANGUAGE] = strings; dark.strings[CURRENT_LANGUAGE] = strings;
dark.Save(darkPath); dark.Save(darkPath);
@ -354,30 +366,33 @@ int main(int, char**)
ImGui::ShowDemoWindow(&show_demo_window); ImGui::ShowDemoWindow(&show_demo_window);
if (ImGui::BeginMainMenuBar()) { if (ImGui::BeginMainMenuBar()) {
if (ImGui::BeginMenu(_TRI_CTX(ICON_FK_FILE, "Main menu", "File"))) { 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(); 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; done = true;
} }
ImGui::EndMenu(); ImGui::EndMenu();
} }
if (ImGui::BeginMenu(_TRI_CTX(ICON_FK_SCISSORS,"Main menu", "Edit"))) { 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; prefs_window = true;
} }
ImGui::EndMenu(); ImGui::EndMenu();
} }
#ifdef DEBUG #ifdef DEBUG
if (ImGui::BeginMenu(_TRI_CTX(ICON_FK_COG, "Main menu (in debug builds)", "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; show_demo_window = !show_demo_window;
} }
ImGui::EndMenu(); ImGui::EndMenu();
} }
#endif #endif
if (ImGui::BeginMenu(_TRI_CTX(ICON_FK_INFO_CIRCLE, "Main menu", "Help"))) { 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; about_window = !about_window;
} }
ImGui::EndMenu(); ImGui::EndMenu();
@ -414,15 +429,15 @@ int main(int, char**)
const float items = 3.0f; const float items = 3.0f;
const float between_items = items - 1.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)); 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(); playback->Update();
} }
ImGui::SameLine(); 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(); playback->Update();
} }
ImGui::SameLine(); 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(); playback->Update();
} }
ImGui::PopItemWidth(); ImGui::PopItemWidth();
@ -432,20 +447,36 @@ int main(int, char**)
ImGui::SetNextWindowDockID(dockid); ImGui::SetNextWindowDockID(dockid);
ImGui::Begin(_TRI_CTX(ICON_FK_COG, "Window title, window opened by menu item", "Preferences..."), &prefs_window); 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); SDL_GL_SetSwapInterval(vsync ? 1 : 0);
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(ImGui::GetWindowWidth() - ImGui::GetCursorPosX() - ImGui::GetStyle().WindowPadding.x); 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")); 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))) { 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; 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 = ""; 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::SetNextItemWidth(ImGui::GetWindowWidth() - ImGui::GetCursorPosX() - ImGui::GetStyle().WindowPadding.x);
ImGui::InputText("##FilterInput", &filter); 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()); ImVec2 ChildSize = ImVec2(ImGui::GetWindowWidth() - (ImGui::GetStyle().WindowPadding.x * 2.0f), -ImGui::GetFrameHeightWithSpacing());
if (ImGui::BeginChildFrame(ImGui::GetID("##ThemesContainer"), ChildSize)) { if (ImGui::BeginChildFrame(ImGui::GetID("##ThemesContainer"), ChildSize)) {
ImVec2 TableSize = ImVec2(0, 0); ImVec2 TableSize = ImVec2(0, 0);
@ -482,7 +513,7 @@ int main(int, char**)
} }
ImGui::EndChildFrame(); ImGui::EndChildFrame();
ImGui::SetNextItemWidth(ImGui::GetWindowWidth() - (ImGui::GetStyle().WindowPadding.x * 2)); 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); 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::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::Text(APP_NAME_STR.c_str());
ImGui::PopFont(); 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)"); 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 != "") { 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::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()); ImGui::Text(APP_NAME_ROMANIZED.c_str());
} }
@ -561,7 +592,7 @@ int main(int, char**)
ImGui::TextUnformatted(_TR_CTX("License viewer label", "License")); ImGui::TextUnformatted(_TR_CTX("License viewer label", "License"));
// Next string is internal. // Next string is internal.
ImGui::BeginChild("license view", ImVec2(0, 0), true); // *don't* leave room for the nonexistant line below us! 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::Separator();
ImGui::TextWrapped("%s", selected.LicenseContents.c_str()); ImGui::TextWrapped("%s", selected.LicenseContents.c_str());
ImGui::EndChild(); ImGui::EndChild();
@ -640,6 +671,11 @@ int main(int, char**)
config["demo_window"] = show_demo_window; config["demo_window"] = show_demo_window;
config["vsync"] = vsync; config["vsync"] = vsync;
config["framerate"] = framerate; config["framerate"] = framerate;
if (lang == DEFAULT_LANG) {
config["lang"] = Json::Value::nullSingleton();
} else {
config["lang"] = lang;
}
stream << config; stream << config;
stream.close(); stream.close();
} }

View file

@ -11,7 +11,7 @@ if get_option('gles') or target_machine.cpu_family() == 'aarch64' or target_mach
endif endif
cfg_data = configuration_data() cfg_data = configuration_data()
cfg_data.set('DEBUG', get_option('debug')) 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 # SDL Mixer X
smx_opts = cmake.subproject_options() 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}) 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/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/neko-player.desktop', install_dir: 'share/applications')
install_data('assets/com.experimentalcraft.NekoPlayer.metainfo.xml', install_dir: 'share/metainfo') 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, exe = executable('neko-player', srcs,
dependencies: deps, dependencies: deps,
include_directories: include_dirs, include_directories: include_dirs,

126
theme.cpp
View file

@ -40,7 +40,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid
ImGuiStyle& style = theme->style; ImGuiStyle& style = theme->style;
ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.50f); ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.50f);
ImVec2 buttonSize = ImVec2((ImGui::GetWindowWidth() * 0.50f) - (ImGui::GetStyle().WindowPadding.x) - (ImGui::GetStyle().ItemSpacing.x * 0.5f), 0); 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; delete theme;
theme = new Theme(false); theme = new Theme(false);
@ -49,7 +49,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid
return true; return true;
} }
ImGui::SameLine(); 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; delete theme;
theme = new Theme(true); theme = new Theme(true);
@ -57,7 +57,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid
ImGui::End(); ImGui::End();
return true; 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.SetTitle(_TR_CTX("Theme Editor file dialog title", "Import theme..."));
importDialog.SetTypeFilters(_TR_CTX("Theme Editor file dialog filter name", "Theme JSON files"), { ".json"}); importDialog.SetTypeFilters(_TR_CTX("Theme Editor file dialog filter name", "Theme JSON files"), { ".json"});
std::string userdir = std::getenv( std::string userdir = std::getenv(
@ -71,7 +71,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid
importDialog.Open(); importDialog.Open();
} }
ImGui::SameLine(); 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.SetTitle(_TR_CTX("Theme Editor file dialog title", "Export theme..."));
exportDialog.SetTypeFilters(_TR_CTX("Theme Editor file dialog filter name", "Theme JSON files"), { ".json"}); exportDialog.SetTypeFilters(_TR_CTX("Theme Editor file dialog filter name", "Theme JSON files"), { ".json"});
std::string userdir = std::getenv( std::string userdir = std::getenv(
@ -95,7 +95,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid
importDialog.Display(); importDialog.Display();
exportDialog.Display(); exportDialog.Display();
if (!theme->file_path.empty()) { 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; string file_path_backup = theme->file_path;
delete theme; delete theme;
theme = new Theme(file_path_backup); theme = new Theme(file_path_backup);
@ -104,82 +104,82 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid
return true; return true;
} }
ImGui::SameLine(); 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); 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; loadOpen = true;
} }
ImGui::SameLine(); 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; saveAsOpen = true;
} }
// Simplified Settings (expose floating-pointer border sizes as boolean representing 0.0f or 1.0f) // 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 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(); 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(); 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(); ImGui::Separator();
if (ImGui::BeginTabBar("##tabs", ImGuiTabBarFlags_None)) 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 | 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 | Description input label", "Description"), &theme->strings["fallback"].description);
ImGui::EndTabItem(); 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::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", "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", "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", "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", "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", "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::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", "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", "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::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::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::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", "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", "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", "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", "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", "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::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::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", "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", "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", "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", "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", "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", "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::SliderFloat(_TR_CTX("Theme Editor | Sizes | Rounding | slider label", "Tab Rounding"), &style.TabRounding, 0.0f, 12.0f, "%.0f");
ImGui::EndTabItem(); 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; 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; 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", "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", "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", "Both"), alpha_flags == ImGuiColorEditFlags_AlphaPreviewHalf)) { alpha_flags = ImGuiColorEditFlags_AlphaPreviewHalf; }
ImGui::BeginChild("##colors", ImVec2(0, 0), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NavFlattened); ImGui::BeginChild("##colors", ImVec2(0, 0), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NavFlattened);
ImGui::PushItemWidth(-160); ImGui::PushItemWidth(-160);
@ -190,7 +190,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid
continue; continue;
ImGui::PushID(i); ImGui::PushID(i);
bool hueEnabled = theme->HueEnabledColors.contains(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) { if (hueEnabled) {
theme->HueEnabledColors.insert(i); theme->HueEnabledColors.insert(i);
} else { } else {
@ -227,16 +227,16 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid
exportDialog.ClearSelected(); exportDialog.ClearSelected();
} }
if (loadOpen) { 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::SetNextWindowPos(ImVec2(0, 0));
ImGui::SetNextWindowSize(ImVec2(window_width, window_height)); 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 path selectedThemePath;
static string filter = ""; 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::SetNextItemWidth(ImGui::GetWindowWidth() - ImGui::GetCursorPosX() - ImGui::GetStyle().WindowPadding.x);
ImGui::InputText("##FilterInput", &filter); 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))) { if (ImGui::BeginListBox("##Themes", ImVec2(ImGui::GetWindowWidth() - (ImGui::GetStyle().WindowPadding.x * 2.0f), -ImGui::GetTextLineHeightWithSpacing() - ImGui::GetStyle().WindowPadding.y))) {
for (auto themePath : Theme::availableThemes) { for (auto themePath : Theme::availableThemes) {
string themeStem = themePath.stem().string(); string themeStem = themePath.stem().string();
@ -252,7 +252,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid
} }
ImGui::EndListBox(); 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()) { if (!selectedThemePath.empty()) {
filter = ""; filter = "";
loadOpen = false; loadOpen = false;
@ -264,7 +264,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid
} }
} }
ImGui::SameLine(); 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(); selectedThemePath = path();
filter = ""; filter = "";
loadOpen = false; loadOpen = false;
@ -273,16 +273,16 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid
} }
} }
if (saveAsOpen) { 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::SetNextWindowPos(ImVec2(0, 0));
ImGui::SetNextWindowSize(ImVec2(window_width, window_height)); 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 selectedThemeName = "";
static string filter = ""; 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::SetNextItemWidth(ImGui::GetWindowWidth() - ImGui::GetCursorPosX() - ImGui::GetStyle().WindowPadding.x);
ImGui::InputText("##FilterInput", &filter, 1024); 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))) { 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) { for (auto themePath : Theme::availableThemes) {
string themeStem = themePath.stem().string(); string themeStem = themePath.stem().string();
@ -299,8 +299,8 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid
ImGui::EndListBox(); ImGui::EndListBox();
} }
ImGui::SetNextItemWidth(ImGui::GetWindowWidth() - (ImGui::GetStyle().WindowPadding.x * 2.0f)); 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); 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"))) { if (ImGui::Button(_TR_CTX("Theme Editor | Save as dialog | Save button", "Save"))) {
path selectedThemePath(selectedThemeName); path selectedThemePath(selectedThemeName);
if (!selectedThemePath.empty() && !selectedThemePath.is_absolute()) { if (!selectedThemePath.empty() && !selectedThemePath.is_absolute()) {
selectedThemeName = ""; selectedThemeName = "";
@ -311,7 +311,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid
} }
} }
ImGui::SameLine(); 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 = ""; selectedThemeName = "";
filter = ""; filter = "";
saveAsOpen = false; saveAsOpen = false;
@ -470,8 +470,8 @@ Theme::Theme(bool dark) : Theme() {
style.WindowRounding = 12; style.WindowRounding = 12;
} }
ThemeStrings::ThemeStrings() { ThemeStrings::ThemeStrings() {
name = _TRS_CTX("Theme default strings > name", "A theme"); name = _TRS_CTX("Theme default strings | name", "A theme");
description = _TRS_CTX("Theme default strings > description", "(No description)"); description = _TRS_CTX("Theme default strings | description", "(No description)");
} }
ThemeStrings Theme::GetStrings() { ThemeStrings Theme::GetStrings() {
char *language_c = CURRENT_LANGUAGE; char *language_c = CURRENT_LANGUAGE;

View file

@ -2,11 +2,11 @@
#include <libintl.h> #include <libintl.h>
#include <string> #include <string>
#include <vector> #include <vector>
// 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) { 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(); std::string msg_ctxt_id = (std::string(ctx) + std::string("\004") + std::string(msgid));
const char *translation = gettext(msg_ctxt_id); const char *translation = gettext(msg_ctxt_id.c_str());
if (translation == msg_ctxt_id) { if (std::string(translation) == msg_ctxt_id) {
return msgid; return msgid;
} else { } else {
return translation; 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 _TRI(icon, str) _TRIS(icon, str).c_str()
#define _TRIS_CTX(icon, ctx, str) (std::string(icon) + _TRS_CTX(ctx, 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 _TRI_CTX(icon, ctx, str) _TRIS_CTX(icon, ctx, str).c_str()
#define CURRENT_LANGUAGE textdomain(NULL) #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)