We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18878
    • 210 Posts
    Hello Modx’ers,

    I have a weird problem, I hope you can help me.

    I need to have the banckend in spanish, so I chose under Configuration=> Site:

    Language: Spanish
    Character Encoding: Latin 9 (ISO) - iso-8859-15

    Everything looks fine, and I can see all Spanish characters with no problems, but when I try to Save any page, or save any configurations or documents, I ALWAYS get the following warning:

    Warning: Cannot modify header information - headers already sent by (output started at /home/cpfoster/public_html/manager/includes/lang/spanish.inc.php:15) in /home/cpfoster/public_html/manager/processors/save_settings.processor.php on line 49


    This never happens when Language: English and Character Encoding: Unicode(UTF-8)-utf-8 are selected.

    For your information, the charset and collation for my database are:
    MySQL charset: UTF-8 Unicode (utf8)
    MySQL connection collation: utf8_general_ci

    NOTE: I tested the spanish backend on both Linux and Windows servers and the problem happens in Linux servers ONLY.

    Any clues please?

    Thanks.

    Mc
      • 18878
      • 210 Posts
      Any ideas please? huh
        • 22303 MODX Staff
        • 10,725 Posts
        Quote from: mcclausky at Jul 28, 2007, 09:55 AM

        Any ideas please? huh
        You need a UTF-8 Spanish translation if you want to run with a database encoded in UTF-8. The settings will be split soon so your database encoding doesn’t have to match the manager language file, but for now, that’s the limitation.
          • 18878
          • 210 Posts
          Quote from: OpenGeek at Jul 28, 2007, 11:45 AM

          Quote from: mcclausky at Jul 28, 2007, 09:55 AM

          Any ideas please? huh
          You need a UTF-8 Spanish translation if you want to run with a database encoded in UTF-8. The settings will be split soon so your database encoding doesn’t have to match the manager language file, but for now, that’s the limitation.

          Thanks for the info.

          In order to make it work now without the "Headers Warning", should I change MySQL charset and MySQL connection collation in phpMyAdmin? What should I choose? Latin1 or similar?

          Your help will be appreciated.

          Mc
            • 22303 MODX Staff
            • 10,725 Posts
            I always recommend running the database with utf-8; all you need to do is convert the spanish language file into utf-8.
              • 18878
              • 210 Posts
              Quote from: OpenGeek at Jul 30, 2007, 11:30 AM

              I always recommend running the database with utf-8; all you need to do is convert the spanish language file into utf-8.

              Thank you.

              I followed your instructions and converted the following file to UTF-8 (with DreamWeaver): manager/includes/lang/spanish.inc.php

              MySQL connection location is set to: utf8_general_ci

              And...inside the manager I selected: Language: Spanish and Character Encoding: Unicode (UTF-8) - utf-8

              The spanish special characters look good, but after saving a document or any settings I still get the same warning: Warning: Cannot modify header information - headers already sent by (output started at /home/cpfoster/public_html/manager/includes/lang/spanish.inc.php:1022) in /home/cpfoster/public_html/manager/processors/save_settings.processor.php on line 49

              Am I forgetting something huh
                • 27376
                • 576 Posts
                Open up the file located at [tt]manager/includes/lang/spanish.inc.php[/tt] in a text editor, scroll all the way to the bottom, and remove all the whitespace after the closing [tt]?>[/tt] tag.
                  • 22303 MODX Staff
                  • 10,725 Posts
                  Indeed, this is a common problem with files that contain only PHP code; any trailing whitespace will be sent as output. This can turn up as phantom whitespace on your pages, that sometimes creates havoc and is hard to track down.

                  Something I often do in files like this is to remove the closing PHP tag from PHP files that only contain PHP. The closing tag is not required by PHP, and by not including it, I avoid the whitespace problem altogether. This would be the ultimate solution if only all PHP editors could properly highlight code without the closing tag.
                    • 18878
                    • 210 Posts
                    Quote from: sirlancelot at Jul 30, 2007, 05:16 PM

                    Open up the file located at [tt]manager/includes/lang/spanish.inc.php[/tt] in a text editor, scroll all the way to the bottom, and remove all the whitespace after the closing [tt]?>[/tt] tag.

                    Guys:

                    Thank you so much for your help. The whitespace at the end was giving me the problem. Now it works smoothly!! grin So, the 2 parts of the solution were: 1) convert the spanish language file to UTF-8 and 2) remove the whitespace at the end of that file.

                    regards!!!

                    Mc