Uniface User Forum

 View Only
Expand all | Collapse all

Uniface 4GL: Managment with multi languages

  Thread closed by the administrator, not accepting new replies.
  • 1.  Uniface 4GL: Managment with multi languages

    ROCKETEER
    Posted 11-19-2018 11:58
    No replies, thread closed.

    Managment with multi languages

    Author: antoine.picaud@free.fr (apicaud)

    Currently (Uniface 9.3), when you change the $language in the application, the current component is not refresed with the $text associated on all fields displayed.

    I would like a function in the 4GL to made a refresh on all labels displayed of the component associated with the current language.



  • 2.  RE: Uniface 4GL: Managment with multi languages

    ROCKETEER
    Posted 11-19-2018 11:58
    No replies, thread closed.

    AFAIK,the standard uniface labels belong to the "canvas" and are genereted only once with the form; therefore, they are not accessable as single widgets; and the only way is to activate the complete form again (exit the current form and re-activate it).

    Uli


    Author: ulrich-merkel (ulrichmerkel@web.de)


  • 3.  RE: Uniface 4GL: Managment with multi languages

    ROCKETEER
    Posted 11-19-2018 11:58
    No replies, thread closed.

    Hi Ulrich,

    I known how work Uniface but, when my customer call me about an issue and if his screen is in Chinese, I don't understand his screen.

    If a possibility to change dynamicaly the view in another language, the maintenance will be more easy.

    Regards, Antoine


    Author: apicaud (antoine.picaud@free.fr)


  • 4.  RE: Uniface 4GL: Managment with multi languages

    ROCKETEER
    Posted 11-19-2018 11:58
    No replies, thread closed.

    Yepp ... it is! But it demands some work ;)

    First consideration is to expand your language code in a way that it can react dynamically:

     

    call load_lang($language) ;### Load content in Language $language

    --- and later ---

    call load_lang("EN") ;### e.g. detail-trigger of some element => Load content in Language "EN"

     

    I assume you to have some sort of code, am i right? So when it comes to change a language you just have to reload the entry or whatever does it for you. If you dont have that, then you have some work, as i stated :)

     

    It's not that tricky, i know. But it requires you to have your homework done.

     

    Hope this could help you on your way

     

    Cheers,

    -GHAN-

     


    Author: -GHAN- (hansen@ahp-gmbh.de)


  • 5.  RE: Uniface 4GL: Managment with multi languages

    ROCKETEER
    Posted 11-19-2018 11:58
    No replies, thread closed.

    AFAIK, this is not true anymore. Start with Uniface 9.3 there is a new function $labelproperties which one can use to change the label text (it works only with attached labels, but it should work).


    Author: sochaz (zdenek.socha@fullsys.cz)


  • 6.  RE: Uniface 4GL: Managment with multi languages

    ROCKETEER
    Posted 11-19-2018 11:58
    No replies, thread closed.

    good news, but I'm afraid it is not so easy to use it to refresh the $text after a change of $language.

    One Option I see is to analyse the content of FORMPIC.UFORM for attached labels
    and create an entry to (re-)set $labelproperties with the $text.

    Looks like this is another task for a 2-phase compile.

    Success, Uli


    Author: ulrich-merkel (ulrichmerkel@web.de)


  • 7.  RE: Uniface 4GL: Managment with multi languages

    ROCKETEER
    Posted 11-19-2018 11:58
    No replies, thread closed.

    Another solution, if in Uniface, a function give all fields painted in the current form, we can change all labels with $labelproperties without known the description at the compilation.

    But I dont't have the instruction to do that.

    Antoine


    Author: apicaud (antoine.picaud@free.fr)


  • 8.  RE: Uniface 4GL: Managment with multi languages

    ROCKETEER
    Posted 11-19-2018 11:58
    No replies, thread closed.

    Hi Antoine,

    unfortunately, there is no reliable function in Uniface so far where you can get all painted fields.

    You can get the painted fields from $entinfo, but AFAI there is no functionality to get all entities painted on a component.

    I use the above mentioned 2-pass compile to get that information.

    And because it is hard-coded afterwards, it is executed much faster than an "indirect access" (onthe the lab mentioned a factor of 10)

    Success, Uli


    Author: ulrich-merkel (ulrichmerkel@web.de)


  • 9.  RE: Uniface 4GL: Managment with multi languages

    ROCKETEER
    Posted 11-19-2018 11:58
    No replies, thread closed.

    hello

    to get the list of painted fields in a component at runtime we are using the functions : $entinfo

    So you can build the painted TREE for every instances of your components.

    the only difficultiy is to get the list of outer entites...(level 0) there is no function to get it.

    so we defined a message (created by a tool) to extract the list of entities we are using (in waiting a new feature of Uniface) .

    something like  : 'select distinct ulabel from uxgroup'....

    but with $entinfo and the topic OUTER / INNER it's not necessary to know every entities. You can find out entities from another.

    Afterwards a standard operation in every component could give you at runtime the $paintedfields.

     


    Author: fmoritz (francois.moritz@hewitt.com)


  • 10.  RE: Uniface 4GL: Managment with multi languages

    ROCKETEER
    Posted 11-19-2018 11:58
    No replies, thread closed.

    Very similar to my way:

    In the <DEFINES> trigger, I place

    #include <$componentname>

    after the first compile of a component:
    - I start a Cleanup
    - I collect all entities / fields / UCOMPSTAMP etc.
    - -and write it as a set of #defines to include proc <$componentname>
    - compile to component a 2nd time to have all that info hardcoded in the FRM

    A typical MYFORM1 include looks like:

    #define UCOMPSTAMP = dd-mm-yyy
    #define entities = ENT_1,Ent_2,Ent_3
    #define fields_ENT_1=fielda,fieldb
    #define fields_ENT_2=field2a,field2b
    #define fields_ENT_3=x_test

    using #for loops we get a much better performance than using uniface lists to do the job
    and you can access all fields by:

    #for entity = (<entities>)
    #for field = (fields_<entity>)

    <field>.<entit<> = ""

    #endfor ; field
    #endfor ; entity

    #undefine field
    #undefine entity

    Success, Uli


    Author: ulrich-merkel (ulrichmerkel@web.de)


  • 11.  RE: Uniface 4GL: Managment with multi languages

    ROCKETEER
    Posted 11-19-2018 11:58
    No replies, thread closed.

    Hello Francois,

    As of Uniface version 9.4 the function $componentinfo will be extended with the topic "OUTERENTITIES", which will return a list of the names of outer entities of the specified component instance.

    Hope this helps.

    Best regards,
    Daniel


    Author: diseli (daniel.iseli@uniface.com)