Load specific language parameter. Possible?

General questions regarding the use of languages in Joomla! 3.x.

Moderators: infograf768, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Post Reply
User avatar
BosseJ
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 220
Joined: Tue Jul 31, 2007 6:00 am

Load specific language parameter. Possible?

Post by BosseJ » Mon Jun 18, 2018 3:11 pm

I just made my site multilingual. My default language is Swedish. So far I have added English and Spanish.

I have two issues:

1. My shop.
I'm using Ecwid Store. The store loads through the Ecwid Joomla component.
Ecwid is shown in the browser specific language. No matter what language you choose in the Joomla language selector module.
So if you are an English speaking Canadian with a browser set to French, Ecwid will show in French even if you chosen English as language in Joomla language selector.
This is something I as store owner can't do anything about. It is what it is.

So, my first question:
Is there any way I can set specific language parameters while choosing language in Joomla language selector? So when the component loads Ecwid it will be in the same language as the site?

2. Auto detection
I have the auto language detection on so if you are from Spain, the site will show in Spanish. From UK/US it's in English. And the same, of course, for Swedish.
But if you are from a country I don't have a language for, it will show in Swedish since that is my default language.

My second question:
Is there a way to make Joomla redirect foreign languages to the English site instead of Swedish? Without making English as default language? Sweden is after all my prime country and I need my domain to continue showing in Swedish.
But it's a better chance that a foreigner understand English...

waarnemer
Joomla! Ace
Joomla! Ace
Posts: 1934
Joined: Sun May 04, 2008 12:37 pm

Re: Load specific language parameter. Possible?

Post by waarnemer » Tue Jun 19, 2018 12:07 pm

issue 1.
You can link to your ecwid store using the url parameter "?lang="
The developes of ECWID should be able to tell you how to adjust that in the component maybe..

issue 2.
As long as your site allows for swedish and your autodetect is on, you and all your fellow swedes will get swedish. As I expect (as in many other countries) the computers locales and thus anything installed on the computers in sweden is "sweden+swedish".
I would set the default to english.
If you are worried about google indexing, no need to. All languages will be indexed equally.. and if you do worry, create a site map for each language
Last edited by waarnemer on Tue Jun 19, 2018 12:16 pm, edited 1 time in total.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18650
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Load specific language parameter. Possible?

Post by infograf768 » Tue Jun 19, 2018 12:14 pm

Let me see though if we could improve multilang by adding a specific parameter for such a situation.
No promess...
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
BosseJ
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 220
Joined: Tue Jul 31, 2007 6:00 am

Re: Load specific language parameter. Possible?

Post by BosseJ » Tue Jun 19, 2018 2:00 pm

waarnemer wrote:issue 1.
You can link to your ecwid store using the url parameter "?lang="
The developes of ECWID should be able to tell you how to adjust that in the component maybe..

issue 2.
As long as your site allows for swedish and your autodetect is on, you and all your fellow swedes will get swedish. As I expect (as in many other countries) the computers locales and thus anything installed on the computers in sweden is "sweden+swedish".
I would set the default to english.
If you are worried about google indexing, no need to. All languages will be indexed equally.. and if you do worry, create a site map for each language
Nops, the "?lang=" didn't work (like ?lang=es).
And nops, I've had long talks with the support. The developer team offererd to build a custom solution. For a hourly rate...

User avatar
BosseJ
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 220
Joined: Tue Jul 31, 2007 6:00 am

Re: Load specific language parameter. Possible?

Post by BosseJ » Tue Jun 19, 2018 2:02 pm

infograf768 wrote:Let me see though if we could improve multilang by adding a specific parameter for such a situation.
No promess...
Hi,
We..? Are you a part of Ecwid team or RocketTheme team (who builds the Ecwid component)? Or just a fellow Joomla-er who like to help..? :)

waarnemer
Joomla! Ace
Joomla! Ace
Posts: 1934
Joined: Sun May 04, 2008 12:37 pm

Re: Load specific language parameter. Possible?

Post by waarnemer » Tue Jun 19, 2018 6:46 pm

@BosseJ

Ha yes.. @Infograf768 maybe is THE authority on multilingual joomla websites. :D
And indeed one of the many fellow Joomla-ers that make this community one of the best I know. Oh wait.. just best. ;)

User avatar
BosseJ
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 220
Joined: Tue Jul 31, 2007 6:00 am

Re: Load specific language parameter. Possible?

Post by BosseJ » Tue Jun 19, 2018 6:48 pm

waarnemer wrote:@BosseJ

Ha yes.. @Infograf768 maybe is THE authority on multilingual joomla websites. :D
And indeed one of the many fellow Joomla-ers that make this community one of the best I know. Oh wait.. just best. ;)
Can't wait... :)

waarnemer
Joomla! Ace
Joomla! Ace
Posts: 1934
Joined: Sun May 04, 2008 12:37 pm

Re: Load specific language parameter. Possible?

Post by waarnemer » Tue Jun 19, 2018 6:57 pm

I don't run any site using ecwid, but I noticed the extension is using an API to ecwid to allow embedding their shop technology in your site.
When I check their API documentation, it shows you can force the language of choice. Just as I thought in my first comment:
https://support.ecwid.com/hc/en-us/arti ... ninmystore?
As I understand the joomla extension uses the api, it should be possible to have it "forced" to run it in the language of your desire.. Only thing is, you are missing this in the extensions options, am I right?

Did you contact the ecwid dev team already for that missing feature? I see they have a do-it-for-me plan but that costs.. but maybe you can explain it is for their benefit as well and they do it for free and for all...

User avatar
BosseJ
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 220
Joined: Tue Jul 31, 2007 6:00 am

Re: Load specific language parameter. Possible?

Post by BosseJ » Tue Jun 19, 2018 7:21 pm

waarnemer wrote:I don't run any site using ecwid, but I noticed the extension is using an API to ecwid to allow embedding their shop technology in your site.
When I check their API documentation, it shows you can force the language of choice. Just as I thought in my first comment:
https://support.ecwid.com/hc/en-us/arti ... ninmystore?
As I understand the joomla extension uses the api, it should be possible to have it "forced" to run it in the language of your desire.. Only thing is, you are missing this in the extensions options, am I right?

Did you contact the ecwid dev team already for that missing feature? I see they have a do-it-for-me plan but that costs.. but maybe you can explain it is for their benefit as well and they do it for free and for all...
Yes, I've talked to them. The thing is, they HAVE a working model for this. On their own demo page. I asked to get either help to get the same or the code to implement it my self or get the "how-to's" if I needed to ask someone to write it for me.
They said no. That is not something they are offering. If I wanted to have that option I'll have to pay a developer to fix it for my site. And pay by the hour. Really not the way to go for a business who offer "A total multilingual store!"...
(their demo: https://www.ecwid.com/demo/)

Well, well... I think I'll have to look elsewhere for a shop...

waarnemer
Joomla! Ace
Joomla! Ace
Posts: 1934
Joined: Sun May 04, 2008 12:37 pm

Re: Load specific language parameter. Possible?

Post by waarnemer » Tue Jun 19, 2018 7:27 pm

Oh shoo... mmh not very nice devs... just out of curiosity, you have the free plan right? ... how is it configured from within Joomla? do you have to enter a URL? or is it by tokens and passwords and such? Do you have a screenshot of such a config?

User avatar
BosseJ
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 220
Joined: Tue Jul 31, 2007 6:00 am

Re: Load specific language parameter. Possible?

Post by BosseJ » Tue Jun 19, 2018 7:44 pm

waarnemer wrote:Oh shoo... mmh not very nice devs... just out of curiosity, you have the free plan right? ... how is it configured from within Joomla? do you have to enter a URL? or is it by tokens and passwords and such? Do you have a screenshot of such a config?
No, I have the Venture plan. I pay ~300USD a year after all the Swedish taxes are added (~200 for the shop + ~100 for some add-ons ). Not the end of the world, but they promise me a multilaguage store. And they can't offer me a working one. And that makes it expensive. If you understand what I mean.
They (Ecwid) have had RocketTheme to build a component. So it's installed in the backend as any component. The settings are very easy: Insert your store number, choose category - done.
There is no way to control what language the Ecwid store should be in.

Edit:
I can of course settle for two languages. Swedish and English. And make English the default language for the store. That way anyone who's not from Sweden will see the English store (this is how I have solved it for now).
But that doesn't solve my problem. I want to be able to reach all of EU and have the store in the major languages English, French, German and Spanish.

waarnemer
Joomla! Ace
Joomla! Ace
Posts: 1934
Joined: Sun May 04, 2008 12:37 pm

Re: Load specific language parameter. Possible?

Post by waarnemer » Tue Jun 19, 2018 9:04 pm

Are you familiar with template overrides?

I downloaded the package and I am just looking into "\com_ecwid\site\views\ecwid\tmpl"

in the default.php I see a list of options that, if I am correct, does create the options that are sort of sent out to the API... why not add the lang to it?

as a test try adding

Code: Select all

'lang'                  => 'whatever_language'
don't forget to put a comma at the end of previous array item.. ;)

It is just a hunch, but if that works, you can make it more intelligent.... and as it is the default.php view, you can create this as template override...

Note..I am not sure this works as I just do this in the blind not having an ecwid shop.... but when this works, it may be possible to do this for all views in the ecwid component...
Not sure for the modules though...

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18650
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Load specific language parameter. Possible?

Post by infograf768 » Wed Jun 20, 2018 6:13 am

My comment did not concern the first question about Ecwid, but the second one about forcing a specific language other than the site default language to be used when detect browser language has failed finding a language (no cookie been yet set).
Will keep you posted.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
BosseJ
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 220
Joined: Tue Jul 31, 2007 6:00 am

Re: Load specific language parameter. Possible?

Post by BosseJ » Wed Jun 20, 2018 6:24 am

waarnemer wrote:Are you familiar with template overrides?

I downloaded the package and I am just looking into "\com_ecwid\site\views\ecwid\tmpl"

in the default.php I see a list of options that, if I am correct, does create the options that are sort of sent out to the API... why not add the lang to it?

as a test try adding

Code: Select all

'lang'                  => 'whatever_language'
don't forget to put a comma at the end of previous array item.. ;)

It is just a hunch, but if that works, you can make it more intelligent.... and as it is the default.php view, you can create this as template override...

Note..I am not sure this works as I just do this in the blind not having an ecwid shop.... but when this works, it may be possible to do this for all views in the ecwid component...
Not sure for the modules though...
I might have misunderstood your aim here. It's not a lack of languages. Ecwid is translated in to just about any language on the planet. And I can pic what languages to activate. So if I have my site in SE, EN, ES, FR and DE, I can limit Ecwid to the same five languages for the store. I can also set the default language to f.x. English, so anyone from countries with other languages will automatically get the English version of the store.

So far, so good...

My problem is that Ecwid is shown in the language based on browser settings. What language I have for Joomla site doesn't matter. When using my default browser, I get the store in Swedish. No matter what language I choose in the lang selector module.
I have another browser with the language settings set to English. And thus Ecwid is shown in English. No matter if I select Swedish for the site.

What I want is of course that Ecwid follows that language set for the site. I want the visitor to decide what language to show, not Ecwid.

Would that be the result of you input above?
Last edited by BosseJ on Wed Jun 20, 2018 6:33 am, edited 1 time in total.

User avatar
BosseJ
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 220
Joined: Tue Jul 31, 2007 6:00 am

Re: Load specific language parameter. Possible?

Post by BosseJ » Wed Jun 20, 2018 6:26 am

infograf768 wrote:My comment did not concern the first question about Ecwid, but the second one about forcing a specific language other than the site default language to be used when detect browser language has failed finding a language (no cookie been yet set).
Will keep you posted.
Ok

waarnemer
Joomla! Ace
Joomla! Ace
Posts: 1934
Joined: Sun May 04, 2008 12:37 pm

Re: Load specific language parameter. Possible?

Post by waarnemer » Wed Jun 20, 2018 6:41 am

@infograf

An idea may be cascading languages falling back into a set default?

like
nl-NL (site default)
en-GB (fall back default)
- en-US
- en-AU
- es-MX
fr-FR (fall back default)
- fr-CH
- fr-CA
- fr-BE
- es-ES

as you see, spanish in Mexico falls back into en-GB, spanish Spain falls back into fr-FR
all else will fall back to Dutch..

maybe something for another topic?

User avatar
BosseJ
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 220
Joined: Tue Jul 31, 2007 6:00 am

Re: Load specific language parameter. Possible?

Post by BosseJ » Wed Jun 20, 2018 6:53 am

waarnemer wrote:@infograf

An idea may be cascading languages falling back into a set default?

like
nl-NL (site default)
en-GB (fall back default)
- en-US
- en-AU
- es-MX
fr-FR (fall back default)
- fr-CH
- fr-CA
- fr-BE
- es-ES

as you see, spanish in Mexico falls back into en-GB, spanish Spain falls back into fr-FR
all else will fall back to Dutch..

maybe something for another topic?
Did you see my answer to your comment above? (sometime one just look at the last posting...)

waarnemer
Joomla! Ace
Joomla! Ace
Posts: 1934
Joined: Sun May 04, 2008 12:37 pm

Re: Load specific language parameter. Possible?

Post by waarnemer » Wed Jun 20, 2018 6:58 am

@BosseJ
Note..I am not sure this works as I just do this in the blind not having an ecwid shop.... but when this works, it may be possible to do this for all views in the ecwid component...
Not sure for the modules though...
It is worth a try as it may save you a lot of money...

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18650
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Load specific language parameter. Possible?

Post by infograf768 » Wed Jun 20, 2018 8:23 am

Had a try and it is not an easy one because we use the detectLanguage() method for Browser preferred language(s) and the results are not only depending on the browser itself (Safari on Mac requires setting this as global OS preferences), but because the browser may have a list of Preferred Languages and not only one language.

Example in my Firefox:
Screen Shot 2018-06-20 at 10.05.21.png
Let me try to explain:
The detectLanguage() method (used in the Language Filter plugin) looks for the full list of the browser preferred languages and uses the first one proposed in the list that fit with the site languages.

So, in the site above, a user looking at the site for the first time when browser settings is on will get different result depending on the list (sef on, when loading "mysite.com" without any URL lang code. Evidently, if a user loads "mysite.com/en/" it would load English).

Your site for example does not use German (de-DE) but Spanish, English and Swedish.
A German user has a list with
  • German
    French
    Whatever // but NOT English, not Swedish, not Spanish
In that case browser settings will not find a matching lang and try to load Swedish as it is default.

I tested successfully a patch to cope with this as detectLanguage() will return NULL.

Basically, I added a parameter in the plugin to define a forced_default_language (in your case would be en-GB, but the param lets choose any Content Language)

Code in the languagefilter plugin would be somthing like:

Code: Select all

			if (!$lang_code && $this->params->get('detect_browser', 0) == 1)
				{
					$lang_code = JLanguageHelper::detectLanguage();

					if (!$lang_code)
					{
						$forced_default_language = $this->params->get('forced_default_language', $this->default_lang);
						$forced_default_language = ($forced_default_language === 'default') ? $this->default_lang : $forced_default_language;
						$lang_code = $forced_default_language;
					}
				}
Now, if the list contains:
  • German
    French
    English
    Whatever // but NOT Swedish
In that case, English will be loaded. No way to modify but you would not care in your case.

But let's say the browser list is
  • German
    French
    Spanish
    Whatever // but NOT English and not Swedish
It will load Spanish, and my patch would be useless because a preferred language IS detected.

If the list contains a unique preferred language, i.e. in that case German, then my patch works fine as detectLanguage() is NULL.

Therefore we could indeed patch and insist on the fact that it COULD work, but we do not warranty it (which is exactly what happens generally speaking with Browser settings defaulting to site default language if not found).

Will discuss this with some other people interested in multingual Joomla.

EDIT: all this though is very complex and it is much simpler to set the default language to English.
Your users with Swedish as preferred language will get Swedish...
You do not have the required permissions to view the files attached to this post.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18650
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Load specific language parameter. Possible?

Post by infograf768 » Wed Jun 20, 2018 8:27 am

Now, concerning ecwid, they SHOULD NOT base their code on browser settings as it just may not work in multingual (as well as possibly in monolanguage as explained above....).
They should make their component multilingual aware the way we do for Core components.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18650
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Load specific language parameter. Possible?

Post by infograf768 » Wed Jun 20, 2018 8:50 am

Hmm, looks like ecwid is not a full joomla component, but an integration. That is quite different.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

waarnemer
Joomla! Ace
Joomla! Ace
Posts: 1934
Joined: Sun May 04, 2008 12:37 pm

Re: Load specific language parameter. Possible?

Post by waarnemer » Wed Jun 20, 2018 9:28 am

As it connects to an API of ecwid I figured the component is missing the language option.
As in the component view the API options are in the default.php of the view... see my previous.

User avatar
BosseJ
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 220
Joined: Tue Jul 31, 2007 6:00 am

Re: Load specific language parameter. Possible?

Post by BosseJ » Wed Jun 20, 2018 10:03 am

@infograf768 and @waarnemer

Discovered more problems with Ecwid that has nothing to do with selected language:
You can't have order/shipment/payment confirmation in more than one language, SEO only use default language, social media sharing is only in one language, you can only have category and product name in one language (not able to translate).

Somethings tells me it's better to go for a Joomla store. I will keep the SE/EN Ecwid as long as I fix with the new shop.

HUGE thanks for your support guys!!

/Bosse

waarnemer
Joomla! Ace
Joomla! Ace
Posts: 1934
Joined: Sun May 04, 2008 12:37 pm

Re: Load specific language parameter. Possible?

Post by waarnemer » Wed Jun 20, 2018 10:58 am

@BosseJ

Out of curiosity I installed it in a test setup.
What I can see is they "insist" on what they think is absolute "best" when it comes to your content and language.
The idea I had doesn't work... as I can see now they sort of check stuff from their local javascripts.. nothing to override or fake.

User avatar
BosseJ
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 220
Joined: Tue Jul 31, 2007 6:00 am

Re: Load specific language parameter. Possible?

Post by BosseJ » Wed Jun 20, 2018 11:08 am

waarnemer wrote:@BosseJ

Out of curiosity I installed it in a test setup.
What I can see is they "insist" on what they think is absolute "best" when it comes to your content and language.
The idea I had doesn't work... as I can see now they sort of check stuff from their local javascripts.. nothing to override or fake.
Hehe... Yes, that's the kind of response I've got from the support. I asked "What if an English speaking Canadian visit the site from a French speaking part of Canada? Or an Spanish guy on vacation in Sweden uses the hotel computer?". The answer: "Tough luck..."!
I have spoken to four different people from support and one of the developers. They really don't understand how I can't realise how great their solution is... :)

waarnemer
Joomla! Ace
Joomla! Ace
Posts: 1934
Joined: Sun May 04, 2008 12:37 pm

Re: Load specific language parameter. Possible?

Post by waarnemer » Wed Jun 20, 2018 11:14 am

...developers thinking they know better how to run a shop than the shopkeeper...

Sorry I cannot help you any further...

User avatar
BosseJ
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 220
Joined: Tue Jul 31, 2007 6:00 am

Re: Load specific language parameter. Possible?

Post by BosseJ » Wed Jun 20, 2018 11:16 am

waarnemer wrote:...developers thinking they know better how to run a shop than the shopkeeper...

Sorry I cannot help you any further...
I don't think anyone can. Great thanks for your time and inut though...

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18650
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Load specific language parameter. Possible?

Post by infograf768 » Thu Jun 21, 2018 7:44 am

I marked the topic as solved.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group


Post Reply

Return to “Language - Joomla! 3.x”