We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Simple Translator (formerly known as Another Language Switcher)

Development and Programming

MID's avatar
MID
166 posts
17 years ago
MID's avatar MID

And the answer is…

To get this to work I had to go into the extension’s settings page and click on ‘submit’ to accept the defaults.

       
Michael C. (KKCJ)'s avatar
Michael C. (KKCJ)
100 posts
17 years ago
Michael C. (KKCJ)'s avatar Michael C. (KKCJ)

Mark, is there any way to get this to display the specified language if its field content exists, and to display the default language’s field content if not? This would be useful in a site where there is not always a translation for 100% of the content, which I imagine happens more often than not.

EDIT: Oops. I feel silly now. 😊 I just did some experimenting and it looks like that’s what the extension does. 😊

       
Michael C. (KKCJ)'s avatar
Michael C. (KKCJ)
100 posts
17 years ago
Michael C. (KKCJ)'s avatar Michael C. (KKCJ)

Ok, real question this time. :p Is there any way to have it pick up on related entries? For example, let’s say I have article-author (a relationship field) pointing to one entry, and article-author_jp (another relationship field) pointing to another entry altogether. The extension doesn’t seem to pick up and switch the field designated in the related_entries’ id=”” parameter, so it would always retrieve the fields from the entry designated in article-author, and never from article-author_jp.

       
atelier2's avatar
atelier2
181 posts
17 years ago
atelier2's avatar atelier2

First I want to thank you for this really very useful extension. Although I am a real newbe in Expression Engine and I am absolutely no code-writer (I use Freeway to have my templates made) I managed to get it working. That says a lot about the way you made this.

But I do have some questions.

I cannot get my page validated. And I noticed exactly the same error on another page that uses your extension .

The validator says:

Line 142, Column 34: document type does not allow element "ul" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag.
        
<ul class="simple-translator"><li class="selected first"><a href="http://ww


The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as ">" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

Another request, that might or might not be related.

Is it possible that for the next update you take away the hyphen in the part in the sourcecode that creates the style ? My software does not allow me to use something like ul.simple-translator (we must use ul.simpletranslator) So I had to add manually this part in my CSS stylesheet. There seems to be a very good reason why Freeway does not allow that, but I cannot explain that.

Hope to hear from you best regards

Atelier

       
Michael C. (KKCJ)'s avatar
Michael C. (KKCJ)
100 posts
17 years ago
Michael C. (KKCJ)'s avatar Michael C. (KKCJ)
First I want to thank you for this really very useful extension. Although I am a real newbe in Expression Engine and I am absolutely no code-writer (I use Freeway to have my templates made) I managed to get it working. That says a lot about the way you made this. But I do have some questions. I cannot get my page validated. And I noticed exactly the same error on another page that uses your extension . The validator says:
Line 142, Column 34: document type does not allow element "ul" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag.
        
<ul class="simple-translator"><li class="selected first"><a href="http://ww


The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as ">" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

I believe your problem is that a UL element should not be placed inside a P element. Generally a hierarchy would be UL -> LI -> P -> [text inside the P] (although the need for a P inside an LI is a matter of personal opinion and taste, I believe).

       
atelier2's avatar
atelier2
181 posts
17 years ago
atelier2's avatar atelier2

Thanks for replying.

We found the solution, after a lot of trial and error. In this case it did help by using a script-action that removes the p-tag from the container. For more info please have a look here: link to discussion .

But the result is that the page gets validated, and that MSIE 6 and 7 renders the code as we want.

       
elemental's avatar
elemental
77 posts
17 years ago
elemental's avatar elemental

I was wondering if any of you who use this extension already, how does Google spiders the alternate languages. Because the URLs are being obfuscated or just changed during access? Or maybe a search engine sitemap.xml could feature all links hardcoded with lang/_sk/ in their URLs (sk for slovak).

Any advice or info is welcome Thank you

       
atelier2's avatar
atelier2
181 posts
17 years ago
atelier2's avatar atelier2

Interesting point. Unfortunately I do not have the solution….sorry

       
Brent Cartier's avatar
Brent Cartier
87 posts
17 years ago
Brent Cartier's avatar Brent Cartier

Very good point…

Mark - how much work would it be to get the extension using a global variable in path.php as described here in the EE Wiki? (like ‘www.mydomain.com/en/group/template’ or ‘www.mydomain.com/fr/group/template’ etc..) I’ll have a look at the code… but I’ll probably just mangle it 😛

-Brent

       
Carlo Poso's avatar
Carlo Poso
35 posts
17 years ago
Carlo Poso's avatar Carlo Poso

Hi, do you know any incompatibilities with Solspace Tag Module?

Looks like page crashes when the {if simple_language == } is put inside a {exp:tag:related_gallery_entries } declaration…

Carlo

       
Michael C. (KKCJ)'s avatar
Michael C. (KKCJ)
100 posts
17 years ago
Michael C. (KKCJ)'s avatar Michael C. (KKCJ)

Mark, I’ve run into a wall. I have custom fields for each weblog, and I’ve adopted a naming scheme of {WEBLOGNAME-body} for my custom fields, since EE requires a unique short name for custom fields, regardless of them being in different field groups.

The problem is when I want to have alternate languages for the {title} field. Normally I’d have custom fields named {title_jp} and be done with it, but since I have to have them named uniquely, and I want to have more than one weblog have alternate language content, Simple Translator obviously doesn’t pick up on the fact that {WEBLOGNAME-title_jp} should be substituted for the {title} field when the language is changed.

The only solution I can think of is to have an “if lang == jp show {WEBLOGNAME-title_jp} else show {title}” conditional in my templates, but it seems rather messy.

Any ideas?

       
Efrain B.'s avatar
Efrain B.
42 posts
17 years ago
Efrain B.'s avatar Efrain B.

Thanks for this extension Mark! Is working great for me.

       
Chad Crowell's avatar
Chad Crowell
242 posts
17 years ago
Chad Crowell's avatar Chad Crowell

Re; Categories

If I have 1 weblog with 10 entries and 1 set of categories called Cats and a corresponding set of categories called Cats_de, riddle me this:

  1. Do both category groups have to be attached to the weblog in edit_groups? or just the english set of categories?
  2. If the answer to #1 is both, do I need to select both the english and german category for each entry in the edit screen?

or does ST just know to show the alternate category list and which cats in the foreign languages that the entries belong to?

Thanks

       
Efrain B.'s avatar
Efrain B.
42 posts
17 years ago
Efrain B.'s avatar Efrain B.

Hey Mark,

Is there a way to be able to translate weblog entries - variable pairs when using the suffix in the category group names (category / category_es) and not on the weblog names????

I need to use the following code and its displays the two languages:

{exp:weblog:entries weblog="weblog_name"}

{categories}

<h2>{category_name}</h2>

{/categories}
       
Efrain B.'s avatar
Efrain B.
42 posts
17 years ago
Efrain B.'s avatar Efrain B.
Re; Categories If I have 1 weblog with 10 entries and 1 set of categories called Cats and a corresponding set of categories called Cats_de, riddle me this: 1. Do both category groups have to be attached to the weblog in edit_groups? or just the english set of categories? 2. If the answer to #1 is both, do I need to select both the english and german category for each entry in the edit screen? or does ST just know to show the alternate category list and which cats in the foreign languages that the entries belong to? Thanks

Hey Chad,

Yes both category groups have to be attached to that one weblog and yes you need to select both, the English and German categories for each entry.

       
First 7 8 9 10 11 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.