Plugin names are not translated when language is changed

Bug #807402 reported by Alexander Wolf
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stellarium
Fix Released
Low
Bogdan Marinov

Bug Description

Khalid AlAjaji reported in maillist: "Plugin names are not translated when language is changed. If I start Stellarium in French, they are not changed If I switch to English. Same happens with other languages."

Related branches

Changed in stellarium:
status: New → Confirmed
milestone: none → 0.11.1
Changed in stellarium:
milestone: 0.11.1 → 1.0.0
Revision history for this message
Bogdan Marinov (daggerstab) wrote :

Is this still an issue? I can't verify it at the moment. If it is, I think fixing it would be easy.

Changed in stellarium:
assignee: nobody → Bogdan Marinov (daggerstab)
importance: Undecided → Low
milestone: 1.0.0 → none
Revision history for this message
Alexander Wolf (alexwolf) wrote :

Yes, this is still an issue

Revision history for this message
Bogdan Marinov (daggerstab) wrote :

I'm afraid I may be partially responsible for this one, because of my comment in ConfigurationDialog::pluginsSelectionChanged(). :( I don't know if it played any role in how plug-ins are translated now, and I can't remember its context. I think that at the time I wanted each plug-in to have its separate .pot file.

I thought that the fix would be easy, but I hit a problem and I need some feedback, especially from Alexander Wolf.

In all cases there should be a call to populatePluginsList() in ConfigurationDialog::languageChanged() in order to re-generate the plug-in name list in the dialog. The problem is that it uses StelModuleMgr::getPluginsList(), and that method calls each plug-in's getPluginInfo() function only once, because the list is built the first time the method is called and after that is simply returned.

To avoid that, I decided to use N_() instead of q_() in the getPluginInfo() methods and translate the strings immediately before they are used. This fixed the bug, with one exception: the Supernovae plug-in. Its description is constructed from two strings, so the q_() function can't find a source string to translate when called for the whole plug-in description. (See the attached patch.)

*Is there a reason for the separate strings?* The way the description is constructed now also creates a problem with localizing punctuation and text flow (RTL vs LTR).

Alternatively, I can modify StelModuleMgr::getPluginsList() to regenerate the whole list every time it's called. The pros and cons of each approach:

For using N_():
+ The original display name and description are preserved.
- The descriptions of the "official" plug-ins should be always a single string.

For modifying getPluginList():
+ Allows more complex descriptions.
- Small performance penalty - this method is called on selecting a plug-in in the list, checking the "load at startup" box and pressing the "configure" button. I don't know how noticeable it will be. I need to check that.

P.S. I still don't have a permanent Internet connection. :(

Revision history for this message
Alexander Wolf (alexwolf) wrote :

>Is there a reason for the separate strings?

I can make description to one string - I don't have special reason for the separate string for description of plug-in.

Revision history for this message
Bogdan Marinov (daggerstab) wrote :

Because this will affect the translations, I'm going to commit the fix after 0.11.1 is released. Unless there will be enough time before the release for the translators to fix it.

Revision history for this message
Bogdan Marinov (daggerstab) wrote :

The fix has been committed as revision 4993 to the trunk branch in Stellarium Bazaar repository:
http://bazaar.launchpad.net/~stellarium/stellarium/trunk/revision/4993

Related is revision 4991, where the description of the Supernovae plug-in was merged into a single string (and edited a bit):
http://bazaar.launchpad.net/~stellarium/stellarium/trunk/revision/4991

Changed in stellarium:
milestone: none → 0.11.2
status: Confirmed → Fix Committed
Revision history for this message
Bogdan Marinov (daggerstab) wrote :

A bug introduced by my patch was fixed by me in revision 4997:
http://bazaar.launchpad.net/~stellarium/stellarium/trunk/revision/4997

Changed in stellarium:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.