外観
MuseScore 本体翻訳コンテキスト一覧
プラグインから qsTranslate("コンテキスト名", "原文") で MuseScore 本体の翻訳を再利用するとき、第 1 引数に指定する コンテキスト名の一覧です。
関連: 国際化開発ガイド / 一次資料 docs/old_docs/i18n.md
出典: musescore/MuseScore の
share/locale/musescore_en.tsおよびinstruments_en.ts(MuseScore Studio 5.0 系ソース時点)。
MuseScore のバージョンによってコンテキストの追加・改名・統廃合があり得ます。確実に使う文言は、同梱の.tsまたは Transifex で原文とコンテキストを確認してください。
1. 使い方
qml
// 音名(本体 global コンテキスト)
qsTranslate("global", "C♯")
// ダイアログ定番(同梱プラグインで多用)
qsTranslate("PrefsDialogBase", "Apply")
qsTranslate("PrefsDialogBase", "Cancel")注意:
- 原文(英語ソース文字列)は本体と一字一句一致させる必要があります。違うと翻訳されません。
- コンテキスト名も本体と一致させる必要があります。
- コンテキストはリリース間で変わることがあるため、重要な UI は独自
qsTrとの併用も検討してください。
2. プラグインで特に使いやすいコンテキスト
| コンテキスト | 向いている用途 | 原文の例(英語) |
|---|---|---|
global | OK/Cancel/Close、一般語、音名など | "OK", "Cancel", "Close", "C", "C♯" |
PrefsDialogBase | 設定ダイアログの Apply/Cancel 等(同梱プラグインで使用) | "Apply", "Cancel", "Save", "Reset", "Quit" |
action | メニュー・コマンド名 | "Quit", "Full screen" など(& 付き表記に注意) |
appshell | ホーム/Plugins などシェル周り | "Plugins", "Scores", "Home menu" |
preferences | 設定関連の語 | "Audio", "Reset to default" |
notation | 記譜・編集 UI | "Capo", "History" |
palette | パレット関連 | "Custom", "Create" |
playback | 再生・ミキサー | "Mute", "Solo", "Measure", "Beat" |
project | スコア/プロジェクト | "Title", "Composer", "Untitled score" |
propertiespanel | プロパティパネル | "Color", "Direction", "Up", "Down" |
engraving | 記譜一般 | "Score", "Articulation" |
engraving/sym | 記号のユーザー向け名称 | (多数の記号名) |
engraving/dynamictype | 強弱記号名 | "p (piano)", "f (forte)" |
engraving/cleftype | 音部記号名 | "Treble clef", "Bass clef" 等 |
engraving/instruments | 楽器名(instruments_*.ts) | 楽器カタログの名称 |
engraving/instruments/family | 楽器ファミリー | |
engraving/instruments/group | 楽器グループ | |
SelectDialog | 選択ダイアログ | "Select", "Same staff" |
TransposeDialogBase | 移調ダイアログ | "Transpose" |
MeasurePropertiesBase | 小節プロパティ | "Measure properties", "Visible" |
PageSettingsBase | ページ設定 | "Page settings", "Portrait" |
EditStyleBase | スタイル設定 | "Style", "Notes", "Rests" |
shortcuts | ショートカット UI | "None" |
instruments | 楽器追加 UI | "Select instrument", "Family" |
PrefsDialogBase は musescore_en.ts のコンテキスト一覧には含まれないことがありますが、同梱の tuning / intervals などレガシー QML プラグインで実際に使われており、実行時に本体側の訳が解決される前提の書き方です。動作は対象の MuseScore 4.x で確認してください。
音名の例(global)
同梱 note_names と同様:
qml
qsTranslate("global", "C")
qsTranslate("global", "C♯")
qsTranslate("global", "D♭")
// … F♭♭♭ 〜 B♯♯♯ などボタン類の例
qml
FlatButton {
text: qsTranslate("PrefsDialogBase", "Apply")
accentButton: true
}
FlatButton {
text: qsTranslate("PrefsDialogBase", "Cancel")
onClicked: quit()
}
FlatButton {
text: qsTranslate("global", "Close")
onClicked: quit()
}3. コンテキストの探し方
- 本ページの一覧(§4)で候補を絞る
share/locale/musescore_ja.ts(またはmusescore_en.ts)を開き、<name>コンテキスト</name>と前後の<source>を確認する- プラグインではその
<source>と同じ文字列をqsTranslateの第 2 引数に渡す - MuseScore の表示言語を切り替えて、訳が出ることを確認する
一覧の再生成(メンテ用):
powershell
python tools/i18n/extract-musescore-contexts.py4. 全コンテキスト一覧
musescore_en.ts と instruments_en.ts から抽出したコンテキストです。文言数は英語カタログのおおよその <message> 数です。
| コンテキスト名 | おおよその文言数(en) |
|---|---|
action | 778 |
AlignSelect | 11 |
appshell | 47 |
appshell/about | 12 |
appshell/gettingstarted | 17 |
appshell/menu/add | 9 |
appshell/menu/add/chordandfret | 1 |
appshell/menu/diagnostics | 10 |
appshell/menu/edit | 1 |
appshell/menu/file | 4 |
appshell/menu/format | 2 |
appshell/menu/help | 1 |
appshell/menu/plugins | 1 |
appshell/menu/tools | 4 |
appshell/menu/view | 4 |
appshell/preferences | 2 |
appshell/welcome | 16 |
braille/notation | 3 |
braille/view | 3 |
BreaksDialog | 5 |
cloud | 3 |
CustomizeKitDialog | 27 |
debugOption | 1 |
EditPitchBase | 26 |
EditStaffBase | 93 |
EditStaffType | 57 |
EditStringDataBase | 6 |
EditStyleBase | 504 |
engraving | 331 |
engraving/bagpipeembellishment | 160 |
engraving/brackettype | 6 |
engraving/cleftype | 37 |
engraving/drumset | 65 |
engraving/dynamictype | 33 |
engraving/gradualtempochangetype | 11 |
engraving/hairpintype | 5 |
engraving/instruments | 2932 |
engraving/instruments/family | 120 |
engraving/instruments/genre | 11 |
engraving/instruments/group | 12 |
engraving/layoutbreaktype | 4 |
engraving/noteheadgroup | 74 |
engraving/noteheadscheme | 9 |
engraving/noteheadtype | 4 |
engraving/ottavatype | 6 |
engraving/playtechtype | 23 |
engraving/propertyName | 382 |
engraving/scoreorder | 13 |
engraving/slurstyletype | 5 |
engraving/spacertype | 3 |
engraving/staffgroup | 3 |
engraving/sym | 441 |
engraving/timesig | 5 |
engraving/tremolotype | 9 |
engraving/trilltype | 4 |
engraving/tripletfeel | 7 |
engraving/vibratotype | 5 |
extensions | 1 |
FontStyleSelect | 4 |
global | 74 |
iex_audio | 1 |
iex_capella | 2 |
iex_guitarpro | 3 |
iex_mei | 1 |
iex_midi | 39 |
iex_musicxml | 11 |
importexport/mnx | 3 |
inspector | 4 |
instruments | 17 |
KeyEdit | 4 |
layoutpanel | 29 |
layoutpanel/instrumentsettingspopup | 11 |
layoutpanel/staffsettingspopup | 11 |
MasterPalette | 1 |
MeasurePropertiesBase | 31 |
musesounds | 15 |
notation | 366 |
notation/add-remove-system-breaks | 1 |
notation/editstaff | 1 |
notation/editstringdata | 3 |
notation/editstyle | 40 |
notation/editstyle/accidentals | 7 |
notation/editstyle/barlines | 3 |
notation/editstyle/bends | 21 |
notation/editstyle/chordsymbols | 42 |
notation/editstyle/hammeronpulloff | 23 |
notation/editstyle/instrumentnames | 42 |
notation/editstyle/repeatplaycount | 6 |
notation/editstyle/slursandties | 16 |
notation/editstyle/stavesharing | 2 |
notation/editstyle/timesignatures | 46 |
notation/editstyle/tupletCentering | 3 |
notation/editstyle/voltas | 41 |
notation/measureproperties | 3 |
notation/percussion | 28 |
notation/staffpartproperties | 4 |
notation/stafftextproperties | 2 |
notation/staffvisibilitypopup | 7 |
notation/timeline | 20 |
notation/undohistory | 1 |
NoteGroups | 9 |
noteInputMethod | 9 |
OffsetSelect | 5 |
PageSettingsBase | 22 |
palette | 225 |
palette/unicodeRanges | 303 |
playback | 112 |
preferences | 186 |
preferences/score | 3 |
project | 110 |
project/cloud | 16 |
project/export | 94 |
project/migration | 10 |
project/newscore | 64 |
project/properties | 7 |
project/save | 61 |
project/share | 6 |
project/template | 41 |
project/templatecategory | 8 |
propertiespanel | 599 |
publish | 1 |
RealizeHarmonyDialogBase | 5 |
SelectDialog | 15 |
SelectNoteDialog | 20 |
shortcuts | 8 |
SpecialCharactersDialog | 1 |
StaffTextPropertiesDialog | 6 |
staveSharingTest | 3 |
SymbolDialogBase | 5 |
systemBrackets | 2 |
TimeDialogBase | 13 |
TimeSigProperties | 5 |
TransposeDialogBase | 66 |
TupletDialog | 10 |
ui | 3 |
undoableAction | 220 |
VoicingSelect | 15 |
workspace | 1 |
5. 参考
| 内容 | 参照 |
|---|---|
| 国際化の手順 | 国際化開発ガイド |
| 翻訳コンパイル自動化 | 翻訳コンパイル自動化 |
| 旧 i18n 解説 | docs/old_docs/i18n.md |
| Transifex(MuseScore) | app.transifex.com/musescore/musescore |