We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18397
    • 3,250 Posts
    Instead of storing language files with each snippet or module what about having a folder structure like this so that all language files are centralized:

    assets/languages/
    |___ en
    | |___ ditto.lang.php
    | |___ modx.lang.php
    |
    |___ fr
    | |___ ditto.lang.php
    | |___ modx.lang.php
    |
    |___ en-uk
    |___ ditto.lang.php
    |___ modx.lang.php

    Then the snippet/module/modx will load the required languages from that folder. The manager will list all available languages by looking at the subfolders of languages. If a language key or file does not exist in the specified language the english one will be used. Language packs will be zipped archives of that specific language’s subfolder.

    Changes: Beautified example tree and added language packs
      • 28215
      • 4,149 Posts
      I like this idea a lot better. Thumbs up. grin
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 25663 MODX Staff
        • 12,272 Posts
        Perfect ... i totally agree ... even for the manager, too.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 33337
          • 3,975 Posts
          Awesome! ... voted!
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link
            • 30223
            • 1,010 Posts
            Awesome idea indeed. So could we get MODx to include the additional files whenever a snippet/module is run instead of leaving this to each resource? I could see some advantages to that.
              • 25663 MODX Staff
              • 12,272 Posts
              I’m sure it could be done, but I’m not sure if it would add needless extra overhead. I see huge benefits in this mainly from having an easier go at keeping languages organized and updated as they evolve over time.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 4626
                • 57 Posts
                I’m not so sure this is a good idea. I think it will cause a lot of problems for snippet/module/plugin-creators who are not associated to the dev-team because and users would have to download the language files for all the snippets/modules/plugins even though they maybe only use one or two. I think a better idea would be to define som sort of stardized way of i18n:izing snippets/modules/plugins and maybe the possibilty of automatically downloading (via a repository) the associated language-file (maybe just saving a serialized array).

                But I’m sure you probably have thought more about this than me... just don’t do anything before you’re sure – I don’t want those of you on the dev-team to waste your time on anything else than 0.9.7/1.0...
                  • 25663 MODX Staff
                  • 12,272 Posts
                  Having a more organized way to manage all the 096 translations would actually be a huge boon to the team. Why could individuals not download only the language files they need, and instead of digging through folder after folder to find where to put them, just drop them in a single spot?
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 4626
                    • 57 Posts
                    Sorry, I didn’t see the topic was in CoreCode (saw the topic via "Show unread posts..."). So this is only for the language-files supplied with the core-package? Then It sounds a lot better!

                    Would this mean that if I want to update i.e. Wayfinder and none of the other core-files have been updated I need to download the whole language package again? What happens if a user forgets (stability issues?)? Will the download-script for each specific package (via Resources) include all the latest language files for the core-package?

                    Sorry for asking stupid questions... You guys probably know better!
                      • 25663 MODX Staff
                      • 12,272 Posts
                      Worst case you download 10-20 language files, of which only 3-5 might ever be used... is that so bad? There is no download script for any Resource today, so it’s all manual installation.
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me