STR #3289

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Post Text | Post File | Prev | Next ]

STR #3289

Application:FLTK Library
Status:5 - New
Priority:4 - High, e.g. key functionality not working
Scope:3 - Applies to all machines and operating systems
Subsystem:FLUID
Summary:Fl_Menu_Items don't have i18n function in them when spit from fluid
Version:1.4-feature
Created By:gga
Assigned To:AlbrechtS
Fix Version:Unassigned
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

Post File ]
Name/Time/Date Filename/Size top right image
 
#1 gga
03:53 Mar 05, 2016
fix.diff
0k
 
 
#2 AlbrechtS
17:32 Mar 07, 2016
fix_v2.diff
1k
 
 
#3 Nikego
14:16 Mar 08, 2016
test-xgettext.fl
8k
 
bottom left image   bottom right image

Trouble Report Comments:

Post Text ]
Name/Time/Date Text top right image
 
#1 gga
03:53 Mar 05, 2016
Current v1.3.3 of fluid does not spit out gettext information for the menus.  It later reads and translates the text, but the original text does not have any gettext in it making it impossible to extract it with xgettext.  
 
#2 AlbrechtS
17:00 Mar 07, 2016
Reassigned high priority - see current discussion in fltk.general titled "xgettext usage for menus". Ref:
https://groups.google.com/forum/#!topic/fltkgeneral/uJkEHrargrs

As Greg pointed out we have several related STR's:

  1. Subject: Enabling "Extract gettext" on fluid menus +
       possibility of static initialization of strings
     http://www.fltk.org/str.php?L2861
     (RomanK, 2012)

  2. Subject: Fl_Menu_Items don't have i18n function in them
       when spit from fluid
     http://www.fltk.org/str.php?L3289
     (gga, 2016)

  Also, perhaps related, here's an STR Matt closed back in 2010 with 1.3:

    Subject: "fluid, i18n, untranslated menus"
    http://www.fltk.org/str.php?L2246
    (gry 2009)
  

  ..and this one, also perhaps related, still open:

    Subject: internationalization
    http://www.fltk.org/str.php?L2678
    (parisse 2011)
 
 
#3 AlbrechtS
17:32 Mar 07, 2016
Converted the given patch (fix.diff) to uniform diff using git. See attached file fix_v2.diff. Please use patch -p1 to apply.  
 
#4 Nikego
14:40 Mar 08, 2016
I attached test-xgettext.fl file. I hope it will be usefull.
There is no external dependencies. The application read "default.mo" file with translations and use them to work. To scan strings from sources and create the .mo file you need xgettext package.

1) scanning of strings
> xgettext.exe -o ./out.pot --from-code=UTF-8 --keyword --keyword=_ test-xgettext.cxx  test-xgettext.h

2) merging with previous set of string (if not exists just copy .pot to .po)
> msgmerge.exe -o ./default.po ./out.po ./out.pot

3) insert other language strings (msgstr) to out.po file in any editor, eg:
..
#: text-xgettext.cxx:218
msgid "File"
msgstr "Datei"
...

4) compilation .po to .mo
> msgfmt.exe -o ./default.mo ./default.po

The current Fluid version creates code that can't be correctly scanned by xgettext, so there was no menu strings in .po (and .mo) file at all.
 
 
#5 AlbrechtS
02:53 Sep 01, 2016
Bumped to 1.4-feature.

A fix in 1.3.4 would certainly break existing user code.
We hope we can find a better solution in FLTK 1.4.0.
 
 
#6 matt
10:45 Jul 07, 2017
Hasn't this all been fixed with the "menu_xxx_i18n_done" system at least in 1.4?  
 
#7 AlbrechtS
13:19 Jul 07, 2017
No, unfortunately not. :-(

Please see my comment #2, particularly the link to the fltk.general google group, but also the links to several other still open or already closed STR's.
https://groups.google.com/forum/#!topic/fltkgeneral/uJkEHrargrs

As far as I understand the attempted fix in FLTK 1.3 [1] was considered a regression by some users because there are no longer gettext(..) or _(..) "markers" (function calls) in the code generated by fluid. Hence xgettext can't be used to extract the strings from the code to generate .po(t) and .mo files to localize the code.

AFAICT the attempted fix in FLTK 1.3 was [1]


I can't tell if this single commit really removed gettext() "markers" from the fluid-generated code, but I assume that this was the case in an attempt to fix startup crashes because of uninitialized static variables (aka "static initialization order fiasco" [2]). Unfortunately I'm not familiar with fluid internals, so I can't contribute a solution.


[1] svn r7822, STR #2246 <http://www.fltk.org/str.php?L2246>
[2] https://isocpp.org/wiki/faq/ctors#static-init-order
 
bottom left image   bottom right image

Return to Bugs & Features | Post Text | Post File ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2021 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.