mutliple non-translatable items from menu and palettes

• Oct 29, 2013 - 16:19
Type
Wording/Translation
Severity
S4 - Minor
Status
closed
Project
Tags

some non-translatable items, some just don't pick up the existing translations

  1. Menu->File->Info... all the labels
  2. Menu->Edit->Workspaces-> the terms "advanced", "basic" and "default"
  3. Palette->Grace Notes all the tooltips
  4. Palette->Clefs all the tooltips
  5. Palette->Key Signatures all the tooltips
  6. Palette->Arpeggios & Glissandi all the tooltips
  7. Palette->Brackets the tooltips "Brace" and "Square"
  8. Palette->Articulations all the tooltips
  9. Palette->Accidentals all the tooltips
  10. Palette->Note Heads all the tooltips
  11. Palette->Tremolo all the tooltips
  12. Palette->Bagpipe Embellishments all the tooltips (regardless of the fix in #23341: Tool tips for bagpipe embellishments' palette items are not translatable)
  13. Palette->Beam Properties all the tooltips
  14. Palette->Symbols all the tooltips
  15. all the above palette issues also in Menu->View->Master Palette

2a91663


Comments

For what concerns the palettes, the problem seems to be the "context" field.
The tooltips in general are written by instruction at line 731 of mscore/palette.cpp

qApp->translate("Palette", cells[idx]->name.toUtf8())

so the context field is called "Palette". However, in the files downloaded from Transifex the context field for the "clefs", for example, is "MS::ClefInfo".
Actually, this is strange, since from line 29 of libmscore/clef.cpp

#define TR(a) QT_TRANSLATE_NOOP("clefTable", a)

the context field should have been "clefTable", which however would not give the expected results since it is different from "Palette" (i.e. the one actually used in palette.cpp).
Similar considerations holds for the other tooltips of the palette.
For example, in the file from Transifex:
- the context for grace notes is "action"
- the context for the keys is "MuseScore"
- the context for the time signatures is "TimeSigProperties"
... et cetera ...

The context for barlines in the palette is "Palette" and therefore their translations appear in the tolltips.

One of the problems involved in this bug is that it seems that each time the TR(x) function is defined as an alias forQT_TRANSLATE_NOOP inside a #define instruction, the corresponding context is not handled properly in the *.ts files of Transifex.
A further example is the dropdown list of "Style" inside a "Text properties" (from a right-click on a text element): the context in the code is defined as "MuseScore" in a #define instruction, the translation is accessed correctly in a "MuseScore" context (line 51 of mscore/textstyle.cpp), but in the Transifex ts file the context is "Ms" and thus the translation does not appear.

Is 'lupdate' working on the source files? If so, these ain't preprocessed, so the marcor replacement of TR() to QT_TRANSLATE_NOOP() hasn't taken place, hence lupdate simply doesn't see them

I wonder why those translations did work in 1.x then?!?
Qt issue?
Or has the (MuseScore) code changed that much in this respect?

ad 1. I guess these are read from the score file directly and as such not translatable at all?

ad 2. I found the string 'advanced' only in ...mscore/workspace.cpp, but in there I didn't find 'default' nor 'basic'.
I found the files "advanced.workspace" and "basic.workspace" in ...share/workspaces, but no "default.workspace", so it is a complete mystery to me where these strings stem from and how to get them translated (and whether at all)

the workspaces names in the menu are derived from the filenames, so not really translatable.
advanced workspace and basic.workspace are delivered together with the nightlies, default.workspace seems to be created on first use in the users' directory. They are xml files in a zipped container( just like .mxl files). Advanced and default seem to have been created once, before translation took place or with a partial translation and seem to have been saved in some translated form (the 'advanced' workspace contains German terms). They are (currently) not translatable, only the default workspace, which gets created on the fly, should pick the translated terms.
So that should explain the non-translated terms in the Palette, when using the basic and advanced workspace.
The terms in the menus and the master palette, as well as in the palette when using the default workspace remaining untranslated though seems to have a different cause. One way to 'fix' these seems to be to copy the new translation to overwrite the ones that come with the nightly build, for some reason, regardless being newer, they don't get picked up otherwise?!?

Status (old) active patch (ready to commit)

Haven't tried that, but found a fix for it anyway. Needs QT_TR_NOOP() and initialization and qApp->translate() at use. See PR #1266

Revisiting the issues from #1 reveals that most are fixed. remaining:

  1. Menu->File->Info..., all the Labels. These need to stay untranslated, I think, as they stem from meta tags directly read from the score.
  2. Menu->Edit->Workspaces-> the terms "Advanced" and "Basic" (see above mentioned PR, which should fix that.)
  3. Palette->Note Heads, all the tooltips, I'm affraid this will need to stay untranslated, as all the symbols from SMuFL are also untranslated and translating them would be a huge task for no real ( or at least not enough) benefit
  4. all the above palette issues also in Menu->View->Master Palette

So once the workspaces are fixed, I guess we can mark this fixed.