Details

      Description

      elrte editor has its i18n files included in the archive

      1. OFBIZ-4051_zh_TW.patch
        0.4 kB
        dukian
      2. elrteUpdateTo1.2.zip
        260 kB
        Sascha Rodekamp
      3. elrte_i18n.zip
        46 kB
        Sascha Rodekamp
      4. elrte_i18n.patch
        7 kB
        Sascha Rodekamp
      5. elret-zh_TW-modified-result.jpg
        22 kB
        dukian

        Activity

        Hide
        Jacques Le Roux added a comment -

        Hi Erwan,

        Could you be more explicit? Thanks

        Show
        Jacques Le Roux added a comment - Hi Erwan, Could you be more explicit? Thanks
        Hide
        Jacques Le Roux added a comment -

        Ha, I see. You mean that we should add our own. And it's done internally, right (at the top of elrte.full.js it's easy to see)? If it the case, I think we should ask elRte team if it could not be externalized, like it's done with jQuery UI for instance. We could then supply our own and other teams as well...

        Show
        Jacques Le Roux added a comment - Ha, I see. You mean that we should add our own. And it's done internally, right (at the top of elrte.full.js it's easy to see)? If it the case, I think we should ask elRte team if it could not be externalized, like it's done with jQuery UI for instance. We could then supply our own and other teams as well...
        Hide
        Erwan de FERRIERES added a comment -

        Hi Jacques,

        elrte is already providing the translation files, in js/i18n. We just have to make it work !

        This issue is more a reminder, as it will be a problem when end-users will be using it. I don't think this would take a lot of time to implement!

        Cheers,

        Show
        Erwan de FERRIERES added a comment - Hi Jacques, elrte is already providing the translation files, in js/i18n. We just have to make it work ! This issue is more a reminder, as it will be a problem when end-users will be using it. I don't think this would take a lot of time to implement! Cheers,
        Hide
        Jacques Le Roux added a comment -

        Thanks Erwan,

        I have added those files at r1043949. Please let me know if it's enough or if we need more work

        Show
        Jacques Le Roux added a comment - Thanks Erwan, I have added those files at r1043949. Please let me know if it's enough or if we need more work
        Hide
        Erwan de FERRIERES added a comment -

        Thanks Jacques, but it seems there is more work than this to be done...

        Show
        Erwan de FERRIERES added a comment - Thanks Jacques, but it seems there is more work than this to be done...
        Hide
        Sascha Rodekamp added a comment -

        Hi guys,
        ok i added a language flag in the editor macro. It reads the language from the userLogin and if the last locale field isn't empty the language file will be loaded.

        to add this feature:
        1.) extract the zip and copy the files to : framework/images/webapp/images/jquery/plugins/elrteEditor/i18n
        2.) apply the patch file

        Have a good day
        Cheers
        Sascha

        Show
        Sascha Rodekamp added a comment - Hi guys, ok i added a language flag in the editor macro. It reads the language from the userLogin and if the last locale field isn't empty the language file will be loaded. to add this feature: 1.) extract the zip and copy the files to : framework/images/webapp/images/jquery/plugins/elrteEditor/i18n 2.) apply the patch file Have a good day Cheers Sascha
        Hide
        Sascha Rodekamp added a comment -

        Oh i missed that you just added the files ... when they in the right directory you simply have to apply the patch Jacques

        thanks a lot

        Show
        Sascha Rodekamp added a comment - Oh i missed that you just added the files ... when they in the right directory you simply have to apply the patch Jacques thanks a lot
        Hide
        Erwan de FERRIERES added a comment -

        I'll look at it tonight ! Thanks Sascha

        Show
        Erwan de FERRIERES added a comment - I'll look at it tonight ! Thanks Sascha
        Hide
        Sascha Rodekamp added a comment -

        Cool Erwan, Thanks

        Show
        Sascha Rodekamp added a comment - Cool Erwan, Thanks
        Hide
        Jacques Le Roux added a comment -

        Sascha, Erwan,

        I had a quick look. As, like jQuery UI, elrte editor uses also the language.country couple, please check that we don't nee to use something like the snippet I have introduced for the calendar

        <set field="initialLocaleComplete" type="String" value="$

        {groovy:parameters?.userLogin?.lastLocale}

        " default-value="$

        {groovy:locale.toString()}

        "/>
        <set field="initialLocale" type="String" value="$

        {groovy:parameters?.userLogin?.lastLocale?.substring(0,2)}

        " default-value="$

        {groovy:locale.toString()?.substring(0,2)?:'en'}

        "/>
        <set field="localeFileNameComplete" type="String" value="/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-$

        {initialLocaleComplete}

        .js"/>
        <set field="localeFileNameComplete" type="String" value="$

        {groovy: localeFileNameComplete.replace('_', '-')}

        "/> <!-- those files are build this way OOTB (ie a - not a _ between language and country -->
        <set field="fileNameComplete" type="String" value="$

        {groovy: org.ofbiz.base.location.FlexibleLocation.resolveLocation('component://images/webapp' + localeFileNameComplete)}

        "/>
        <set field="localeFileName" type="String" value="/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-$

        {initialLocale}

        .js"/>
        <set field="localeJsFile" type="String" value="$

        {groovy: fileNameComplete ? localeFileNameComplete : localeFileName}

        "/>
        <set field="layoutSettings.javaScripts[+0]" value="$

        {localeJsFile}

        " global="true"/>

        From elrte.zh_TW. I suppose that the replace('_', '-') trick should not be needed

        Thanks

        Show
        Jacques Le Roux added a comment - Sascha, Erwan, I had a quick look. As, like jQuery UI, elrte editor uses also the language.country couple, please check that we don't nee to use something like the snippet I have introduced for the calendar <set field="initialLocaleComplete" type="String" value="$ {groovy:parameters?.userLogin?.lastLocale} " default-value="$ {groovy:locale.toString()} "/> <set field="initialLocale" type="String" value="$ {groovy:parameters?.userLogin?.lastLocale?.substring(0,2)} " default-value="$ {groovy:locale.toString()?.substring(0,2)?:'en'} "/> <set field="localeFileNameComplete" type="String" value="/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-$ {initialLocaleComplete} .js"/> <set field="localeFileNameComplete" type="String" value="$ {groovy: localeFileNameComplete.replace('_', '-')} "/> <!-- those files are build this way OOTB (ie a - not a _ between language and country --> <set field="fileNameComplete" type="String" value="$ {groovy: org.ofbiz.base.location.FlexibleLocation.resolveLocation('component://images/webapp' + localeFileNameComplete)} "/> <set field="localeFileName" type="String" value="/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-$ {initialLocale} .js"/> <set field="localeJsFile" type="String" value="$ {groovy: fileNameComplete ? localeFileNameComplete : localeFileName} "/> <set field="layoutSettings.javaScripts [+0] " value="$ {localeJsFile} " global="true"/> From elrte.zh_TW. I suppose that the replace('_', '-') trick should not be needed Thanks
        Hide
        Erwan de FERRIERES added a comment -

        Done at 1044132. Thanks Jacques and Sascha.

        Show
        Erwan de FERRIERES added a comment - Done at 1044132. Thanks Jacques and Sascha.
        Hide
        Sascha Rodekamp added a comment -

        Thanks Erwan for you're effort

        Show
        Sascha Rodekamp added a comment - Thanks Erwan for you're effort
        Hide
        Jacques Le Roux added a comment -

        As I suspected this needs a bit more work to handle the language.country.couple case. I will handle it. I have found also a small bug. Anyway I'm merging the branchin the trunk so it will be fixed in the trunk...

        Show
        Jacques Le Roux added a comment - As I suspected this needs a bit more work to handle the language.country.couple case. I will handle it. I have found also a small bug. Anyway I'm merging the branchin the trunk so it will be fixed in the trunk...
        Hide
        Jacques Le Roux added a comment -

        Oops sorry, it's ok, actually it was only the language file which was missing. So only this little bug to fix when you come from a form, cool

        Show
        Jacques Le Roux added a comment - Oops sorry, it's ok, actually it was only the language file which was missing. So only this little bug to fix when you come from a form, cool
        Hide
        dukian added a comment -

        Thanks for Jacques highlights Chinese issue.

        After checks two cases: datepicker is fine, but el-rte not.

        There are many different i18n file naming approaches for Traditional Chinese ... OFBiz uses java way: zh_TW, datepicker uses zh-TW, and el-rte needs patch as attachment(OFBIZ-4051_zh_TW.patch).

        According to elrte.(min|full).js, the full version is Line 1108:

        this.lang = (''+this.options.lang).toLowerCase();
        this._i18n = new eli18n({textdomain : 'rte', messages : { rte : this.i18Messages[this.lang] || {}} });

        el-rte needs lower case "TWO_LETTER_LANG_CODE" in translation file.

        I'll file this issue to el-rte project too.

        Show
        dukian added a comment - Thanks for Jacques highlights Chinese issue. After checks two cases: datepicker is fine, but el-rte not. There are many different i18n file naming approaches for Traditional Chinese ... OFBiz uses java way: zh_TW, datepicker uses zh-TW, and el-rte needs patch as attachment( OFBIZ-4051 _zh_TW.patch). According to elrte.(min|full).js, the full version is Line 1108: this.lang = (''+this.options.lang).toLowerCase(); this._i18n = new eli18n({textdomain : 'rte', messages : { rte : this.i18Messages [this.lang] || {}} }); el-rte needs lower case "TWO_LETTER_LANG_CODE" in translation file. I'll file this issue to el-rte project too.
        Hide
        Jacques Le Roux added a comment -

        Thanks Dukian,

        Right they look rather for a zh_tw file. It's weird that someone (Tad <tad0616@gmail.com>) recently provided the elrte.zh_TW.js file though. I wonder if s/he did not test it at all. You could maybe also contact her/him?

        Your patch is in trunk at r1044615, we don't use the jQuery branch anymore

        Show
        Jacques Le Roux added a comment - Thanks Dukian, Right they look rather for a zh_tw file. It's weird that someone (Tad <tad0616@gmail.com>) recently provided the elrte.zh_TW.js file though. I wonder if s/he did not test it at all. You could maybe also contact her/him? Your patch is in trunk at r1044615, we don't use the jQuery branch anymore
        Hide
        Jacques Le Roux added a comment -

        I reopen in order to track the issue Dukian reported...

        Show
        Jacques Le Roux added a comment - I reopen in order to track the issue Dukian reported...
        Hide
        dukian added a comment -

        Mr. Tad responded it works for him.

        It's weird, so I dived into elRTE's code. Please ref. https://github.com/Studio-42/elRTE/commits/stable/src/elrte/js/elRTE.js

        commit ba88b196(Sept 18): .lang be converted to lower case in line 30:

        this.lang = (''+this.options.lang).toLowerCase();

        commit e341aedf(Sept 15): uses .lang directly in line 45:

        this._i18n = new eli18n({textdomain : 'rte', messages : { rte : this.i18Messages[this.options.lang] || {}} });

        Mr. Tad translated zh_TW file be commited Sept 15 (http://elrte.org/redmine/issues/192), but elRTE 1.1 releases Spet 20, so it's sadly for zh_TW users ...

        I reported to elRTE project several days ago, they correct this problem and follow ICU rules (http://userguide.icu-project.org/locale). Please ref. http://elrte.org/redmine/issues/311, https://github.com/Studio-42/elRTE/blob/stable/src/elrte/js/elRTE.js . Mr. Nevelin says it'll be fixed in version 1.2.

        My suggestion is keep current works, and wait elRTE next version.

        Show
        dukian added a comment - Mr. Tad responded it works for him. It's weird, so I dived into elRTE's code. Please ref. https://github.com/Studio-42/elRTE/commits/stable/src/elrte/js/elRTE.js commit ba88b196(Sept 18): .lang be converted to lower case in line 30: this.lang = (''+this.options.lang).toLowerCase(); commit e341aedf(Sept 15): uses .lang directly in line 45: this._i18n = new eli18n({textdomain : 'rte', messages : { rte : this.i18Messages [this.options.lang] || {}} }); Mr. Tad translated zh_TW file be commited Sept 15 ( http://elrte.org/redmine/issues/192 ), but elRTE 1.1 releases Spet 20, so it's sadly for zh_TW users ... I reported to elRTE project several days ago, they correct this problem and follow ICU rules ( http://userguide.icu-project.org/locale ). Please ref. http://elrte.org/redmine/issues/311 , https://github.com/Studio-42/elRTE/blob/stable/src/elrte/js/elRTE.js . Mr. Nevelin says it'll be fixed in version 1.2. My suggestion is keep current works, and wait elRTE next version.
        Hide
        Sascha Rodekamp added a comment -

        Thanks for you're comment and clarification dukian. Think waiting for the next version is a good idea and makes live easier

        Show
        Sascha Rodekamp added a comment - Thanks for you're comment and clarification dukian. Think waiting for the next version is a good idea and makes live easier
        Hide
        Jacques Le Roux added a comment -

        Thanks Dukian and Sascha,

        I agree

        Show
        Jacques Le Roux added a comment - Thanks Dukian and Sascha, I agree
        Hide
        Sascha Rodekamp added a comment -

        Hi,
        here is the update to the new elRte 1.2 Version. It seems that see zh_TW Bug is fixed, the language is loaded correctly.

        @dukian can you please doublecheck?

        To apply the patch:

        • extract the zip file
        • copy the files under the jquery/plugins/elrte folder

        Thanks
        Sascha

        Show
        Sascha Rodekamp added a comment - Hi, here is the update to the new elRte 1.2 Version. It seems that see zh_TW Bug is fixed, the language is loaded correctly. @dukian can you please doublecheck? To apply the patch: extract the zip file copy the files under the jquery/plugins/elrte folder Thanks Sascha
        Hide
        Jacques Le Roux added a comment -

        Sascha,

        I just tried, I don't see the headers and fonts names in Chinese (tried zh, zh_CN and zh_TW)

        Though I see they have changed the 1108 line

        from
        this.lang = (''+this.options.lang).toLowerCase();
        to
        this.lang = (''+this.options.lang);

        Could I have missed something? BTW, it does not work either in French... (I still see English) No errors in OFBiz log nor in js console.

        I tried seeing nodes at https://localhost:8443/content/control/WebSiteCms?webSiteId=CmsSite.

        What and where did you see it working?

        Thanks

        Show
        Jacques Le Roux added a comment - Sascha, I just tried, I don't see the headers and fonts names in Chinese (tried zh, zh_CN and zh_TW) Though I see they have changed the 1108 line from this.lang = (''+this.options.lang).toLowerCase(); to this.lang = (''+this.options.lang); Could I have missed something? BTW, it does not work either in French... (I still see English) No errors in OFBiz log nor in js console. I tried seeing nodes at https://localhost:8443/content/control/WebSiteCms?webSiteId=CmsSite . What and where did you see it working? Thanks
        Hide
        Sascha Rodekamp added a comment -

        Hi Jacques, i think the problem with the CMS site is, that the Editor is called directly from the FTL.

        I only checked the call from from a form like here:
        https://demo-trunk.ofbiz.apache.org/content/control/EditBlogArticle?articleContentId=BLG10000&blogContentId=BLOGROOTBIGAL

        French works for me. Or did i get something wrong?

        Cheers
        Sascha

        Show
        Sascha Rodekamp added a comment - Hi Jacques, i think the problem with the CMS site is, that the Editor is called directly from the FTL. I only checked the call from from a form like here: https://demo-trunk.ofbiz.apache.org/content/control/EditBlogArticle?articleContentId=BLG10000&blogContentId=BLOGROOTBIGAL French works for me. Or did i get something wrong? Cheers Sascha
        Hide
        Jacques Le Roux added a comment -

        Hi Sascha,

        Yes you are right, so it was already working w/out your changes here (I did not commit anything yet).

        I noticed some weird things though.

        We will have to see at least what's happenning with FTL 1st, so I don't close...

        Thanks!

        Show
        Jacques Le Roux added a comment - Hi Sascha, Yes you are right, so it was already working w/out your changes here (I did not commit anything yet). I noticed some weird things though. If you get to the url you C/pasted directly w/out changing the language it does not work. If after changing the language you get to another page and get back again it does not work either If you get back from changing language after being at https://demo-trunk.ofbiz.apache.org/content/control/WebSiteCms?webSiteId=CmsSite you get a weird screen (we need to create a new issue for that...) We will have to see at least what's happenning with FTL 1st, so I don't close... Thanks!
        Hide
        Jacques Le Roux added a comment -

        Fixed at
        trunk r1178175
        R11.04 r1178181

        Show
        Jacques Le Roux added a comment - Fixed at trunk r1178175 R11.04 r1178181

          People

          • Assignee:
            Jacques Le Roux
            Reporter:
            Erwan de FERRIERES
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development