• Resolved Aureola

    (@aureola)


    Hello,
    Does anyone have a suggestion on what to do..? I have been creating my multisite, multi-lingual WP-theme on localhost to practice and to make sure nothing goes wrong when later redoing it on the live server.
    Everything works fine on localhost so I just can’t figure out why it doesn’t detect my language files on the server?

    I uploaded the languages folder (created on my computer with PO Editor) to the theme folder on the server, including all the four files created by the editor; the projectname.mo, projectname.pot and the es_ES.po & es_ES.mo-file. In my functions-php I have this:

    add_action( 'after_setup_theme', 'my_theme_setup' );
    function my_theme_setup(){
        load_theme_textdomain('ctequestrian',  get_template_directory() . '/languages');

    just as I have on my localhost.
    What is it that has changed..? I so hope that someone here can help..

Viewing 10 replies - 1 through 10 (of 10 total)
  • Everything between the local/live site is the same? Same theme activated and same plugins active?

    Thread Starter Aureola

    (@aureola)

    Well, the difference is the operating system and the database versions ( I run 5.6.12 and the server runs a somewhat earlier version) and I use WAMP and the server uses Apache.

    But regarding the Plugins I do notice a difference! :O
    On my localhost, I can go to each site’s Plugins (and see the same setup of plugins on each) but on the server I can only see plugins if I go to the top site; if I go the site1/site2 Plugins, it says “You do not appear to have any plugins available at this time”
    I have Multisite Language Switcher installed though and it is working (I get translation icons on each page; I get the flags and language descriptions in the header – although with the wrong flag, but I think that’s because the language file isn’t detected.).

    Are you able to access the direct URLs for each file on the live server?

    Thread Starter Aureola

    (@aureola)

    Direct URL, what does that mean?
    I’m able to see, edit, change, overwrite any file on the live server, if that helps?

    Thread Starter Aureola

    (@aureola)

    And actually I must have been mistaken; I do NOT have a translation icon for each of the wp pages on the live site. So this must mean that the plugins are actually not working. But as far as I know, the MSLS doesn’t “load” any translations; that’s entirely done by the functions.php file, the load_theme_textdomain function. The MSLS plugin (again, as far as I understand) only adds some extra stuff for the admin panel, the backend, to make the two sites more easy to overview as for what has been translated. It does not load the .mo file which holds all the translations for the theme files.

    Edit: I searched for this issue (that plugins don’t show up on each site) but it seems it’s expected behaviour; you can choose to either Network Activate or activate each plugin on each site).

    Thread Starter Aureola

    (@aureola)

    The path is correct: But i can not access the path like that from the browser. But if I go through my webserver’s file manager the path is this:
    https://webfilemanager.one.com/#ct-equestrian.com/wp-content/themes/wp-ctequestrian/languages/es_ES.po (and es_ES.mo)

    (wp-ctequestrian is the name of my theme)

    Looks like it is directly accessible here: https://ct-equestrian.com/wp-content/themes/wp-ctequestrian/languages/es_ES.po

    So at least it is on the server and readable which is good. Sounds like it might be a plugin issue though since there is a difference between your local environment and the production environment. I’m not too familiar with multiple languages in WordPress though unfortunately ??

    Thread Starter Aureola

    (@aureola)

    Ok. Thanks for trying to help me anyway.

    Hope that someone else has a clue.

    Thread Starter Aureola

    (@aureola)

    Hi,

    Problem found, but not completely solved. THe problem was in the MSLS plugin documentation(?); it says the languages folder should be in the template directory, this is also where the functions-php points to, so I don’t really get why it is like this. But as soon as I copied the folder to the wp-content folder, it started to work. However now I can only see both translations in header when on the spanish page, not the english one, but that’s another question..

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘WP doesn't detect language files when on server, works on localhost’ is closed to new replies.