Skip to content

Commit 1bc37e2

Browse files
authored
Add note about exception for Commands
1 parent 4a8a6d5 commit 1bc37e2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

technical/translation.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ CmdDoAThing::CmdDoAThing()
176176
```
177177
Note that `sGroup` should not be translated here (you will still find many counterexamples in older code, however).
178178

179+
If for any reason you need to manually set the name of the command's menu item or tooltip, you will need to explicitly (and manually) set the context to the name of the class, e.g.:
180+
```
181+
action->setText(QCoreApplication::translate("MyCommandClass", "Some text to be translated"));
182+
```
183+
179184
## UI Files
180185

181186
For the most part, all strings in UI files are automatically subject to translation. In some circumstances you may want to *disable* that translation. Using Qt Designer, uncheck the "translatable" checkbox on the widget that you want to disable translation for.

0 commit comments

Comments
 (0)