Title: Multilingual Content not working
Last modified: August 8, 2018

---

# Multilingual Content not working

 *  [1name](https://wordpress.org/support/users/1name/)
 * (@1name)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/multilingual-content-not-working/)
 * Hello!
 * I am currently setting up a website that has content in two languages: primary
   is German, secondary English. I am using [Sublanguage](https://wordpress.org/plugins/sublanguage/)
   to manage multilinguality, including setting up different permalinks, etc.
 * However, when using ALM to display posts, they are always displayed in the primary
   language, no matter how often I switch to English and check if the URL actually
   contains `/en/`, which it does.
    Not only the post content remains in German 
   but everything else too, including the template parts for which my theme provides
   translations (i.e. “read more” link text). Considering that, I figured that the
   problem most likely isn’t query related. It appears as if ALM doesn’t recognize
   the language variable or something like that.
 * Sublanguage does support AJAX, [as stated in the FAQ](https://wordpress.org/plugins/sublanguage/#how%20to%20access%20language%20data%20in%20javascript%20for%20ajax%20usage%20%3F),
   but since my knowledge of AJAX is close to zero, the information provided doesn’t
   really help me..
 * Do you have any idea how to fix this problem?
 * Thanks!
 * PS: I don’t know if this has anything to do with the above, but I also noticed
   that `the_excerpt()` produces a different output when used in my ALM repeater
   template than when in theme template files. While the latter show a “read more”
   link by themselves, `the_excerpt()` within the ALM repeater template only puts
   out “[…]” without a link at the end of the excerpt’s text.
    -  This topic was modified 7 years, 11 months ago by [1name](https://wordpress.org/support/users/1name/).
    -  This topic was modified 7 years, 11 months ago by [1name](https://wordpress.org/support/users/1name/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/multilingual-content-not-working/#post-10586020)
 * Hi [@1name](https://wordpress.org/support/users/1name/),
    Sorry for the delay
   as I was away.
 * ALM does not officially support sublanguage plugin so I’m not sure how to get
   it working.
    It does support Polylang and WPML.
 * Do you know if there is documentation on how to use sublanguage with a custom
   WP Query?
 * Cheers,
 *  Thread Starter [1name](https://wordpress.org/support/users/1name/)
 * (@1name)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/multilingual-content-not-working/#post-10586139)
 * Hi [@dcooney](https://wordpress.org/support/users/dcooney/),
 * thanks for your reply!
 * Unfortunately, I couldn’t find any info on how Sublanguage deals with custom 
   queries. I don’t know what exactely to look for, maybe you’re more successful
   than I was browsing [the plugin’s Git repo](https://github.com/maximeschoeni/sublanguage).
   It does say something about the case:
 * > If you need to access data through AJAX, you just need to add the wanted language
   > slug into the ajax request […]
 * but having no knowledge of JavaScript, I didn’t understand most of [what came afterwards](https://github.com/maximeschoeni/sublanguage#ajax).
 * I found quite a few discussions dealing with issues concerning ALM and Polylang
   or WPML, which mostly concluded with setting the `lang` parameter in the call
   to `ajax-admin.php`. I tried to play around with it a little but got no result–
   literally, _nothing_ changed, no matter if it was set to `en`, `en-US` or `en_US`:/
   I also tried setting it using the global `$sublanguage` variable, as proposed
   in [the plugin’s readme](https://github.com/maximeschoeni/sublanguage/blob/master/readme.md).
   This one should also be available through JS
 * However, if I changed the site’s language (from the admin panel’s settings) to
   English, so did the content loaded by ALM.
 * If it is any help: I am currently testing the setup [here](https://homepage.univie.ac.at/florian.schwarz/en/links/).
   As you can see, the URL contains `/en/` and menu and tab tags are loaded in English.
 * `get_bloginfo('language')` shows the correct value. I am querying it to determine
   which widget shall be displayed.
 * Thanks again for your reply and any further help you can provide 🙂
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/multilingual-content-not-working/#post-10605176)
 * I asked on the support forums… [https://wordpress.org/support/topic/wp_query-2/](https://wordpress.org/support/topic/wp_query-2/)
 * Ill try to add built in for this soon.
 * You could also try using the `<a href="https://connekthq.com/plugins/ajax-load-
   more/docs/filter-hooks/#alm_query_args" rel="noopener" target="_blank">alm_query_args
   </a>` filter if you have development knowledge.
 *  Thread Starter [1name](https://wordpress.org/support/users/1name/)
 * (@1name)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/multilingual-content-not-working/#post-10606731)
 * Thanks for your reply, [@dcooney](https://wordpress.org/support/users/dcooney/)!
 * I tried to use the `alm_query_args` filter, but setting `$args['lang'] = 'en'`
   or `$args['language'] = 'en'` both didn’t change the output to English – not 
   even after I added the code from the support forum thread you linked above to
   my child theme’s `functions.php` (if this is where this kind of code would go..)
 * Furthermore, when inspecting using Firefox’ built-in function, the AJAX query’s
   argument for `lang` still appeared as empty, despite the new `id` argument showing
   up correctly. When I tried setting `$args['language']` no `language` argument
   showed up in this view at all, the empty `lang` argument remained.
 * HOWEVER!
    When I manipulate the AJAX query by myself and set an argument `language
   =en`, the JSON reply appears to be partly English: [see here](https://homepage.univie.ac.at/florian.schwarz/wp-admin/admin-ajax.php?action=alm_query_posts&nonce=2808b4cfdf&query_type=standard&language=en&post_id=71&slug=links&canonical_url=https%3A%2F%2Fhomepage.univie.ac.at%2Fflorian.schwarz%2Fen%2Flinks%2F&cache_logged_in=false&repeater=default&theme_repeater=null&acf=&nextpage=&cta=&comments=&users=&post_type%5B%5D=buchprojekte&post_type%5B%5D=+drittmittelprojekte&post_type%5B%5D=+dissertationen&sticky_posts=&post_format=&category=&category__not_in=&tag=&tag__not_in=&taxonomy=&taxonomy_terms=&taxonomy_operator=&taxonomy_relation=&meta_key=&meta_value=&meta_compare=&meta_relation=&meta_type=&author=&year=&month=&day=&post_status=&order=DESC&orderby=date&post__in=&post__not_in=&exclude=&search=&custom_args=&posts_per_page=2&page=0&offset=0&preloaded=false&seo_start_page=1&paging=false&previous_post=).
   The links to the single entries are now to the respective English versions (`/
   en/` in URL), but article title and text, translated by Sublanguage, as well 
   as the meta-labels, translated using `__()` are still in German.
 * Any ideas? 😀
 * Thanks a lot for your effort and interest!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Multilingual Content not working’ is closed to new replies.

 * ![](https://ps.w.org/ajax-load-more/assets/icon-256x256.png?rev=2944639)
 * [Ajax Load More – Infinite Scroll, Load More, & Lazy Load](https://wordpress.org/plugins/ajax-load-more/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-load-more/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-load-more/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-load-more/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-load-more/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-load-more/reviews/)

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)
 * [i18n](https://wordpress.org/support/topic-tag/i18n/)
 * [l10n](https://wordpress.org/support/topic-tag/l10n/)
 * [language](https://wordpress.org/support/topic-tag/language/)

 * 4 replies
 * 2 participants
 * Last reply from: [1name](https://wordpress.org/support/users/1name/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/multilingual-content-not-working/#post-10606731)
 * Status: not resolved