Jump to content

Is there a way to make some articles bilingual


Steph40

Recommended Posts

I do it on my site. Here's how to copy it.

If you're creating a manual Page in the ACP, then enter some code like this:

{{if member.language()->id === 1 }}English content{{else}}Other content{{endif}}

That works because English is my language with the id 1. If the user uses my other language, the other content is loaded.

If you want to be able to post multilingual content using the editor, then you'll need to make sure that your user group has Can post HTML? set to YES. (Members > Groups > edit > Look under Group Settings tab.) Click the source button on your editor and you can type the above code in.

Alternatively, you could use the following plugin to create custom language strings and then place the string in your page template:

 

 

Link to comment
Share on other sites

  • 4 weeks later...

I just got around to trying making an article bilingual with @Fosters custom string and it does not work in an article but it works fine in a page. I want some articles bilingual for site description and want we offer and use them with @opentype page superblocks for my home page.

Hopefully I am clear enough, if someone has an idea please share it.

Link to comment
Share on other sites

6 minutes ago, Steph40 said:

… and want we offer and use them with @opentype page superblocks for my home page.

I can’t think of a way to do that easily with Pages blocks or article databases. Would require lots of template edits and additional fields. 

It’s probably easier just to separate the content entirely. Per language pages or blocks and then just wrap the entire output with the code Meddysong provided. 

Link to comment
Share on other sites

1 minute ago, opentype said:

I can’t think of a way to do that easily with Pages blocks or article databases. Would require lots of template edits and additional fields. 

It’s probably easier just to separate the content entirely. Per language pages or blocks and then just wrap the entire output with the code Meddysong provided. 

Thank you, heading that way.

Link to comment
Share on other sites

Unfortunately this won’t work with our app! ( not today ? )

There’s a difference in searchable, dynamic  content ( e.g. posts, blog posts , articles) and translatable strings like forum names, Navbar items and such stuff.. but it’s not impossible:D it could be accomplished with some custom coding.. I’ll research this further next week. That’s in fact an interesting usecase for our app or another similar app with more features 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...