Results 1 to 9 of 9

Thread: Dynamically load phrases (translations)

  1. #1
    Sencha User
    Join Date
    Oct 2015
    Posts
    37
    Answers
    1

    Default Dynamically load phrases (translations)

    Hello,


    I can't find if there is any plugin for application phrases (translations) to be loaded dynamically upon view load and only for that view needed phrases not for entire application?


    If not, maybe you know any good alternatives?



    Thanks!
    M

  2. #2
    Sencha User
    Join Date
    Apr 2013
    Posts
    908
    Answers
    105

    Default

    Quote Originally Posted by MrMe View Post
    Hello,


    I can't find if there is any plugin for application phrases (translations) to be loaded dynamically upon view load and only for that view needed phrases not for entire application?


    If not, maybe you know any good alternatives?



    Thanks!
    M
    Saki made a buggy proof of concept. From my own experience, it's possible to implement proper solution but it takes a bit of time and using actual text instead of proper keys (like Pat Mchler suggests in his comment) to search translation store is just a bad idea.

  3. #3
    Sencha User
    Join Date
    Jan 2016
    Posts
    462
    Answers
    60

    Default

    Mitch created one a while ago that could probably be easily ported to Ext6... see https://github.com/mitchellsimoens/Ux.locale.Manager

  4. #4
    Sencha User
    Join Date
    Apr 2013
    Posts
    908
    Answers
    105

    Default

    Quote Originally Posted by alex.volfson View Post
    Mitch created one a while ago that could probably be easily ported to Ext6... see https://github.com/mitchellsimoens/Ux.locale.Manager
    Saki's proof of concept is based on Mitch's idea. Both don't work that well...

  5. #5
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    Quote Originally Posted by hakimio View Post
    Saki's proof of concept is based on Mitch's idea. Both don't work that well...
    Mind providing some actual details behind that?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  6. #6
    Sencha User
    Join Date
    Apr 2013
    Posts
    908
    Answers
    105

    Default

    Quote Originally Posted by mitchellsimoens View Post
    Mind providing some actual details behind that?
    Just run the demo Saki provided.
    From the top of my head:
    • Lots of component's are not properly translated, ie Tbtext, datefield, grid
    • If property doesn't have a setter and is included in localeproperties array, using that property will result in an exception
    • A lot of component properties (ie textfield emptytext) are not translatable
    • Message dialogs are not translated
    • Combobox store translation will not work when it's remote store
    • It's impossible to have per view translation due to some classes being global singletons (ie Ext.Date & Ext.util.Format)
    Some pics:
    test1.png
    test2.png
    test3.png
    There are many more, but I am not at work right now and it's Friday. If you are really interested I can list more on Monday.
    Anyway, IT IS possible to make it work properly (and I have done that), but it's a bad translation implementation in general and not worth using.

  7. #7
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    In my repo, in the readme, I have this:

    I have NOT checked every component to see if this works. There are some popular overrides that I have done as an example.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  8. #8
    Sencha User
    Join Date
    Jan 2016
    Posts
    462
    Answers
    60

    Default

    I used it and it worked for an app that made it to production. Not every single component and config is handled for you, but that was not difficult to supplement. I never went in thinking it was a turnkey solution.

  9. #9
    Sencha User
    Join Date
    Apr 2013
    Posts
    908
    Answers
    105

    Default

    Quote Originally Posted by mitchellsimoens View Post
    In my repo, in the readme, I have this:
    Even the ones which you checked don't work that well.
    Anyway, I understand that it's just a proof of concept. It's not supposed to work well.

Similar Threads

  1. How to load app dynamically ?
    By sanjay_1985 in forum Sencha Ext JS Q&A
    Replies: 1
    Last Post: 7 Jan 2016, 8:05 AM
  2. Replies: 1
    Last Post: 25 Sep 2014, 10:48 PM
  3. Load CSS dynamically
    By bforbhavin in forum Ext: Q&A
    Replies: 1
    Last Post: 20 Jun 2014, 12:40 PM
  4. Dynamically load
    By Grimsk in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 30 Oct 2007, 5:23 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •