jcsteh / osara

OSARA: Open Source Accessibility for the REAPER Application
GNU General Public License v2.0
127 stars 46 forks source link

Inability to translate custom action names #690

Open reaperaccessible opened 2 years ago

reaperaccessible commented 2 years ago

Hi,

I translate French Ca.

  1. When I activate a peak watcher on a track and return to the peak watcher context menu, Level type: and value of Level type is not translated. Is it possible to add translation strings please?

  2. Here are the Reaper actions that are not translated. Custom: Edit marker at cursor Custom: Move to item peak and report the position Custom: Reset phase for all tracks Custom: Select and move to first track Custom: Select and move to last track Custom: Select and move to master track Custom: Select and open item in midi editor Custom: Select and split item under edit or play cursor Custom: Select from cursor to end of project Custom: Select from cursor to start of project Custom: Solo exclusive next track Custom: Solo exclusive previous track Custom: Turn record monitor off for all tracks Custom: add stretch marker to cursor and snap to grid Custom: fast forward Custom: insert and name track Custom: insert/edit tempo marker and add stretch marker at cursor Custom: trim left edge of items respecting ripple Custom: trim left edge of items respecting ripple Custom: trim right edge of items respecting ripple

jcsteh commented 2 years ago
1. When I activate a peak watcher on a track and return to the peak watcher context menu, Level type: and value of Level type is not translated.
   Is it possible to add translation strings please?

Can you please provide exact steps to reproduce this and an example of the string you see in English? I can't think of any translatable strings that are missing here.

2. Here are the Reaper actions that are not translated.
   Custom: Edit marker at cursor

Ah. It's not possible to make action names translatable, as they're part of the key map, not the OSARA code. I guess we could have different key maps for every language, but that is a pretty massive challenge:

  1. We'd need a different key map for every language. Since the language has to be determined when REAPER starts, we wouldn't be able to install the key map for the user; the user would have to do it manually. This is the biggest problem from a user perspective.
  2. Either each translator would have to maintain their own key map, or
  3. We'd need automated code to extract custom action names from the key map and make them translatable via Crowdin.
jcsteh commented 2 years ago
1. When I activate a peak watcher on a track and return to the peak watcher context menu, Level type: and value of Level type is not translated.

Oh, maybe I do see the issue. I was confused because there's no "Level type:" string in the context menu for English. However, I do see that the level type (e.g. peak dB) isn't translated there. I'll fix that in a sec.

reaperaccessible commented 2 years ago

Ok, but I don't understand. There are already 53 actions translated with Crowdin. What is the difference with custom actions and others?

jcsteh commented 2 years ago

The action names translatable with Crowdin are for actions built into OSARA's C++ code. Custom actions are defined in REAPER's actions dialog and just chain other actions together. Those are stored in the key map, not in the code, so the code doesn't have a chance to translate them.

reaperaccessible commented 2 years ago

Ok Jamie, thanks for the explanation. Would it be possible to create an OSARA action in C for each custom action that would call the custom action by its ID? You can then edit custom actions in KeyMap Actions for OSARA with the same keyboard shortcut. There would no longer be a keyboard shortcut assigned to custom actions in the KeyMap. In this way, everything would be translatable. Thanks again my friend.

jcsteh commented 2 years ago

That's not really feasible. It would be hard to keep the ids in sync with the key map, etc. I think we'd be better off reimplementing the custom actions in C++ code, but that will mean more stuff in C++, and there are less C++ coders than there are people who can maintain the key map. Urgh.

jcsteh commented 2 years ago

In terms of implementation, it wouldn't be too hard to write a framework to define some OSARA actions as a set of REAPER action ids and write a script to convert the existing custom actions. That doesn't solve the problem of future maintenance for such things, though.