FLTK logo

STR #3289

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   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 | SVN ⇄ GIT ]

STR #3289

Application:FLTK Library
Status:1 - Closed w/Resolution
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:matt
Fix Version:1.4.0
Fix Commit:29531873ea4395a2dc65cefcc28db09569c38c18
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:


Name/Time/Date Filename/Size  
 
#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
 
     

Trouble Report Comments:


Name/Time/Date Text  
 
#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
 
 
#8 AlbrechtS
10:17 Dec 04, 2021
Unassigned myself.  
 
#9 AlbrechtS
14:24 Dec 11, 2021
After some investigation I came to the conclusion (reasonable suspicion) that the attempt to fix STR #2246 is the root cause of this issue in FLTK 1.3:

svn r7822:

commit 32f48c30337a0517797836b08dbe8b9c70cb79bc
Author: Matthias Melcher <fltk@matthiasm.com>
Date:   Fri Nov 12 11:55:10 2010 +0000

    Fixed missing internationalisation of menus generate by Fluid (STR #2246)
    
    git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7822 ea41ed52-d2ee-0310-a9c1-e6b18d33e121


This commit removed the xgettext compatible marks (macros or function calls) that were in use in FLTK 1.1.
 
 
#10 matt
17:12 Dec 18, 2021
Fixed in Git repository.

https://github.com/fltk/fltk/pull/343
 
     

Return to Bugs & Features ]

 
 

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