We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25663 MODX Staff
    • 12,272 Posts
    I’ve been chatting with Paul this morning and we’ve come to the conclusion that it might behoove us to release 0.9.5 as a "base" installation including a minimum of language options. These would include at a minimum French and English, as I think those two are the only completed items. We could then create a language pak item in our Repository, that includes a "translation template" as the base release and to which translation teams can add extras as the language packs. This would look (I think) like the following. What am I missing (other than it sure would be nice to have a language pack installer)?

    README-en.txt – basic readme/new install instructions

    manager/includes/lang/english.inc.php - main language file for manager
    manager/includes/lang/country/english_country.inc.php - drop-down list of countries

    assets/snippets/ditto/lang/english.inc.php
    assets/snippets/eform/lang/english.inc.php
    (not needed for Wayfinder or Jot; Jot has all language in the templates)

    assets/modules/docmanager/lang/english.inc.php
    assets/modules/quick_edit/lang/english.inc.php

    And speaking of languages, do all resources revert to english if the language default in the manager or in the user override is not found?
      Ryan Thrash, MODX Co-Founder
      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
      • 22815
      • 1,097 Posts
      Quote from: rthrash at Nov 01, 2006, 09:49 AM

      And speaking of languages, do all resources revert to english if the language default in the manager or in the user override is not found?

      The Manager does it this way (manager/index.php)
      // include_once the language file
      if(!isset($manager_language)) {
          $manager_language = "english"; // if not set, get the english language file.
      }
      $_lang = array();
      include_once "lang/english.inc.php";
      $length_eng_lang = count($_lang);
      if($manager_language!="english") {
          include_once "lang/".$manager_language.".inc.php";
      }


      eForm (at least the version I have) does it this way:
      	#include language files
      	include_once($snipPath."eform/lang/english.inc.php");
      	$form_language = isset($language)?$language:$modx->config['manager_language'];
      	if($form_language!="english" && $form_language!='') {
      		include_once $snipPath ."eform/lang/".$form_language.".inc.php";
      	}

      which would fail if your manager language doesn’t exist as an eform language.

      Searching for "manager_language" in snippets finds any problem points.
        No, I don't know what OpenGeek's saying half the time either.
        MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
        Forum: Where to post threads about add-ons | Forum Rules
        Like MODx? donate (and/or share your resources)
        Like me? See my Amazon wishlist
        MODx "Most Promising CMS" - so appropriate!
        • 30223
        • 1,010 Posts
        eForm (at least the version I have) does it this way:

        Has been fixed in the latest version. Here’s how it is done now:

        <?php
        
        	#include default language file
        	include_once($snipPath."eform/lang/english.inc.php");
        
        	#include other language file if set.
        	$form_language = isset($language)?$language:$modx->config['manager_language'];
        	if($form_language!="english" && $form_language!='') {
        		if(file_exists($snipPath ."eform/lang/".$form_language.".inc.php"))
        			include_once $snipPath ."eform/lang/".$form_language.".inc.php";
        		else 
        		  if( $isDebug ) $debugText .= "<strong>Language file '$form_language.inc.php' not found!</strong><br />"; 
        	}
        ?>
        
          • 25663 MODX Staff
          • 12,272 Posts
          Can someone check the other resources out to see if they’ll gracefully fall back as eForm does now?

          Good grin
          eForm
          Doc Manager
          Ditto

          Work needed
          Quick Edit – There is a separate Front End editor language preference intermixed for the main setting, which I supposed could be a good thing, but it’s in an awkward place. There is also QE strings still in the main language file. These main-language-fiel defines should be removed, as they’re overriding the module language files.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 22815
            • 1,097 Posts
            Ditto 1.0.2 allows you to set a language when you call Ditto, but if not set it will always use English regardless of the Manager language. This is perfectly acceptable.

            The new eForm code looks great - it allows you to set a language for the form, but if you don’t specify a language it will try to use one that matches the Manager language. If files aren’t found, there’s just a silent debug message. Fantastic, this really does what you’d expect it to do.

            So, as I use "english-british", eForm will now be trying to find eform/lang/english-british.inc.php, won’t find it, and will silently record an error that I could see if I had debug mode on. Therefore it would run slightly faster if I specify within eForm my language as "english", because then it won’t do the file check or add to the debug string, and so in general it is best practice to specify the language.

            (There’s not particularly much point making a British English eForm file as there’s only one line to change and that’s an obscure error message!)

            Now, I’m not altogether certain that picking up the Manager language is essential, but it would be trivial to reuse the eForm method in Ditto. If we want to be consistent, we could suggest that it is used in that way. But the most important thing at the moment is that it doesn’t break!
              No, I don&#39;t know what OpenGeek&#39;s saying half the time either.
              MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
              Forum: Where to post threads about add-ons | Forum Rules
              Like MODx? donate (and/or share your resources)
              Like me? See my Amazon wishlist
              MODx "Most Promising CMS" - so appropriate!
              • 4018
              • 1,131 Posts
              One last thing that I think we should really do before pushing out this release....we need to get all the WebFX stuff out of the manager. I’ve been getting alot of strange quirks with TinyMCE lately and every error I’ve seen keeps pointing to the webelm.js file. Seems it is interacting with TinyMCE and causing all sorts of havoc. After removing the line from the header.inc.php file that calls the modx.js script (which links the webelm.js script), all the quirks disappeared. Heck, even resizing works in TinyMCE now! smiley

              Only behavior I can see that is linked to this script is the action buttons...which still work but would need some modest CSS changes to mimic the rollovers. The main ones I’d like to target are the webelm.js and the cb2.js scripts so we can effectively remove them from the header and eliminate them. Doing so will greatly improve the functionality of many plugins...especially TinyMCE!! This is now priority one for me.

              L8R!

              Jeff
                Jeff Whitfield

                "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
                • 30223
                • 1,010 Posts
                Detected a small error in language file english.inc.php (line484) in MODx rev 1858.

                The href attribute has incorrectly escaped quotes:
                includes\lang\english.inc.php(484): $_lang["mgrlog_sortinst"] = 'You can sort the table by clicking on the column headers. If the logs are becoming too large, you can <a href=\"index.php?a=55\">empty</a> the logs. This will remove all log entries up to now, and cannot be undone!';
                


                This causes an error when you want to empty the logs

                edit: have filed a bug report: #630
                  • 25663 MODX Staff
                  • 12,272 Posts
                  Jeff, I think that many of the output widgets are dependent on webelm, but I don’t know about anything else in the manager that is... I’m all for it honestly, and think we could definitely improve the manager usability by adjusting a few things here and there, buttonwise ... (I see a few more style.php additions coming tongue)

                  This should go in for the RC. Can we get this out by tomorrow EOD?
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 4018
                    • 1,131 Posts
                    Don’t see why we couldn’t get these changes into the next RC. I’ll definitely have some time this afternoon and tonight to work on this. And if some of the output widgets rely on some of these scripts we can evaluate them and see how they are implemented. If they don’t interfere with the functionality of the manager then they can be left alone for now. Otherwise, we’ll need to look at ways of substituting what’s there. smiley

                    More to come...

                    Jeff
                      Jeff Whitfield

                      "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
                      • 22815
                      • 1,097 Posts
                      I know it’s set for 0.9.7, but just because it annoys me I’m taking on FS#529 (make Add Another, Continue Editing etc labels) which involves mutate_content.dynamic.php (among other files).

                      In my test install (not in my branch, still need to refresh that) I have this going, but while I was at it I’ve tried adding Firefox 2’s new spell-check to other fields. It works really well!

                      If you don’t know, Firefox 2 automatically enables Word-style wavy-line spell-checking on textareas. Users can also right click on any text field to turn spell-checking on. Or it can be suggested in the HTML ("suggested", because users can turn it off again).

                      Therefore, we can add this to Title, Long Title, Description, Alias and Menu Title really easily. (And ignore the link attributes text field and menu index text fields, because they’re not appropriate.) All we need to add is
                      spellcheck="true"
                      to the input attributes. It’s trivial.

                      BUT... Some people might get sniffy about including non-standard attributes that compliance-checking robots might dislike. If this was a front-end thing I’d recommend a toggle, but it’s not. I think that extended support for Firefox spell-checking is a plus point for MODx. In principle, do y’all agree that this is OK?
                        No, I don&#39;t know what OpenGeek&#39;s saying half the time either.
                        MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                        Forum: Where to post threads about add-ons | Forum Rules
                        Like MODx? donate (and/or share your resources)
                        Like me? See my Amazon wishlist
                        MODx "Most Promising CMS" - so appropriate!

                      This discussion is closed to further replies. Keep calm and carry on.