Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python bug when creating keywords for hazard layers #2453

Closed
severinmenard opened this issue Oct 28, 2015 · 11 comments
Closed

Python bug when creating keywords for hazard layers #2453

severinmenard opened this issue Oct 28, 2015 · 11 comments
Assignees
Milestone

Comments

@severinmenard
Copy link

Got this Python error after clicking on next at the Flood or Generic classes step (see below) for a polygon flood layer. The layer does not have a field with classes, only one with the same values for all the objects. I have other hazard layers with the same kind of attributes but I managed to achieve the keywords wizard

selection_033

Python error:

Traceback (most recent call last):
File "/home/severin/.qgis2/python/plugins/inasafe/safe/gui/tools/wizard_dialog.py", line 3844, in on_pbnNext_released
self.set_widgets_step_kw_field()
File "/home/severin/.qgis2/python/plugins/inasafe/safe/gui/tools/wizard_dialog.py", line 1193, in set_widgets_step_kw_field
subcategory['name'])
TypeError: not enough arguments for format string

Version de Python :
2.7.6 (default, Jun 22 2015, 18:01:27)
[GCC 4.8.2]

Version de QGIS :
2.10.1-Pisa Pisa, exported

Chemin vers Python : ['/home/severin/.qgis2/python/plugins/processing', '/usr/share/qgis/python', u'/home/severin/.qgis2/python', u'/home/severin/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', u'/home/severin/.qgis2//python', '/home/severin/.qgis2/python/plugins/inasafe', '/home/severin/.qgis2/python/plugins/inasafe/safe_extras/parameters', '/home/severin/.qgis2/python/plugins', '/home/severin/.qgis2/python/plugins/inasafe/safe_extras', '/home/severin/.qgis2/python/plugins', '/usr/share/qgis/python/plugins/fTools/tools', '/home/severin/.qgis2/python/plugins/cadastre/forms', '/media/severin/DATA/Documents/OSM/Malawi/Malawi_GIS/03_PROJECTS/0301_QGIS']

@severinmenard
Copy link
Author

I tested it yesterday on another computer and same 3.2.1 version and got the same blocking issue. But just got the answer when changing the language: it comes from the (my) French translation. I guess something that is a value has been translated. Could you please tell me what it is so that I clean it in Transifex?
Beyond this specific issue, would be good for the translators to have a way to know what must not be translated. Added a Transifex comment regarding new text strings with brackets.

@ismailsunni
Copy link
Member

hi @severinmenard

Beyond this specific issue, would be good for the translators to have a way to know what must not be translated. Added a Transifex comment regarding new text strings with brackets.

We just register a string that needs to be translated, so all strings in transifex should be safe to be translated.

I tested it yesterday on another computer and same 3.2.1 version and got the same blocking issue. But just got the answer when changing the language: it comes from the (my) French translation. I guess something that is a value has been translated. Could you please tell me what it is so that I clean it in Transifex?

I need to check it, I will come back to you if I have found something. It should affect the other languages also. Perhaps, there is a string that is "accidentally" registered.

Thanks, really help.

@ismailsunni ismailsunni assigned ismailsunni and unassigned borysiasty Nov 4, 2015
@ismailsunni
Copy link
Member

Hi @severinmenard
I have found the culprit.
This string:

You have selected <b>classified</b> data for the vector <b>%s</b> layer. Please select the attribute in this layer that represents the classes.

is translated with double %s.

No worries, I have fixed it in transifex. It will be solved when we merged my translations PR.

Thanks :)

@severinmenard
Copy link
Author

Sorry for the typo, and thanks for the fix

On Thu, Nov 5, 2015 at 4:46 AM, Ismail Sunni notifications@github.com
wrote:

Hi @severinmenard https://github.com/severinmenard
I have found the culprit.
This string:

You have selected classified data for the vector %s layer. Please select the attribute in this layer that represents the classes.

is translated with double %s.

No worries, I have fixed it in transifex. It will be solved when we merged
my translations PR.

Thanks :)


Reply to this email directly or view it on GitHub
#2453 (comment).

@ismailsunni
Copy link
Member

I will close this since it have been fixed in version 3.2.2

@severinmenard
Copy link
Author

Hello,

Actually the bug is still present in the French version with the new v3.2.3.
Is it something that could be fixed quicly and lead to a rebuild of v3.2.3?
What would mean, I guess, the user would have to desinstall then reinstal
v3.2.3?

On Wed, Nov 11, 2015 at 6:05 AM, Ismail Sunni notifications@github.com
wrote:

I will close this since it have been fixed in version 3.2.2


Reply to this email directly or view it on GitHub
#2453 (comment).

@ismailsunni ismailsunni reopened this Nov 25, 2015
@ismailsunni
Copy link
Member

Hmm, this is strange. I get the same error again now. I am pretty sure I fix the problem before it's released.

I have updated the string that caused the problem: https://www.transifex.com/aifdr/inasafe-apps/translate/#fr/safe/59829406 *you need to login to see this though. See my comment above (#2453 (comment)) about the problem.

Anyway, I have checked version 3.2.3 and develop. They are different.
https://github.com/inasafe/inasafe/blob/version-3_2_3/i18n/inasafe_fr.ts#L3304

<translation>Vous avez sélectionné donnée &lt;b&gt;classifiée&lt;/b&gt; pour la couche vectorielle &lt;b&gt;%s %s&lt;/b&gt;. Sélectionnez SVP l’attribut de cette couche qui contient les classes. </translation

https://github.com/inasafe/inasafe/blob/develop/i18n/inasafe_fr.ts#L3281

<translation>Vous avez sélectionné donnée &lt;b&gt;classifiée&lt;/b&gt; pour la couche vectorielle &lt;b&gt;%s&lt;/b&gt;. Sélectionnez SVP l’attribut de cette couche qui contient les classes. </translation>

For some reason, in version 3.2.3 we didn't manage to update the translation from transifex.

Anyway, the problem is already fixed, but it's not in 3.2.3 yet. We only need to release 3.2.4 from develop (whose updated translation).

What do you think @timlinux , is it possible?

@ismailsunni ismailsunni self-assigned this Nov 25, 2015
@timlinux
Copy link
Contributor

@severinmenard can you test against 3.2.4 (available in plugin manager) to see if it works for you now?

Thanks!

@ismailsunni
Copy link
Member

Tested in my local. I will close this. Free to re-open if still get the error.

@severinmenard
Copy link
Author

Sorry I thought I had informed it works fine now, but seems I did not.

On Mon, Jan 11, 2016 at 2:32 AM, Ismail Sunni notifications@github.com
wrote:

Tested in my local. I will close this. Free to re-open if still get the
error.


Reply to this email directly or view it on GitHub
#2453 (comment).

@ismailsunni ismailsunni reopened this Jan 12, 2016
@ismailsunni
Copy link
Member

Ah, I miss read your comment. I will close this again now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants