After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 673092 - Conversion characters are unsupported
Conversion characters are unsupported
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
0.4.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
Depends on:
Blocks: 673106
 
 
Reported: 2012-03-29 15:40 UTC by Arash Mousavi
Modified: 2012-03-29 19:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Arash Mousavi 2012-03-29 15:40:01 UTC
On non-latin languages with local numbers (like Persian) we use %I conversion modifier to show the local shape numbers should be used instead of Latin numbers. Whenever I click on a document for preview, it shows and error:

Unable to load "%s" for preview
Unsupported conversion charecter %I

I replaced all %Id on translations to %d and preview works now. Seems gnome-documents have some problems with these conversion modifiers.
Comment 1 Cosimo Cecchi 2012-03-29 16:55:47 UTC
Yeah; this is because we can't use the standard library implementation of printf() directly from Javascript, and our implementation ([1], but it's copied verbatim from gnome-shell's implementation), doesn't support that modifier.

A fix for this would be to implement the format() JS method on top of an introspected C helper which uses the standard printf() from glibc.

As a temporary workaround, my suggestion is not to use that modifier in translations.

[1] http://git.gnome.org/browse/gnome-documents/tree/src/format.js
Comment 2 Arash Mousavi 2012-03-29 17:16:12 UTC
You should be wrong in this case. As far as I know, gnome-shell supports these modifiers and we're using it. 
At first it wasn't possible too, but I'm sure they implemented it, I searched for it but couldn't find the specific bug.
Comment 3 Cosimo Cecchi 2012-03-29 18:32:12 UTC
(In reply to comment #2)
> You should be wrong in this case. As far as I know, gnome-shell supports these
> modifiers and we're using it. 
> At first it wasn't possible too, but I'm sure they implemented it, I searched
> for it but couldn't find the specific bug.

I don't see how that could possibly work (for translated strings coming from JS files), since gnome-shell uses the same code as gnome-documents there.
Comment 4 Arash Mousavi 2012-03-29 18:45:35 UTC
Oops, seems that you're right. what I was talking about was #648678 that is about dates. Should I file a bug for gnome-shell?
Comment 5 Arash Mousavi 2012-03-29 18:46:22 UTC
Sorry, this bug is what I mentioned above https://bugzilla.gnome.org/show_bug.cgi?id=648678
Comment 6 Cosimo Cecchi 2012-03-29 19:29:26 UTC
Okay, I now pushed a fix to gnome-documents that makes it support %Id conversion specifiers as requested.
I also prepared a similar patch for gnome-shell, and cloned this bug there to bug 673106.
Comment 7 Arash Mousavi 2012-03-29 19:40:24 UTC
Thanks man! That was so quick! I reverted my change to translation files now :)
Thanks again.