Overriding language value with spaces and variables

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
iDanny
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 193
Joined: Sun Jun 08, 2008 7:56 pm
Location: Montreal
Contact:

Overriding language value with spaces and variables

Post by iDanny » Wed Sep 18, 2013 10:49 am

Hi,

Many extensions use spaces and variables "%" in there language constants.

These can't seem to be changed thought the override.

Is there a trick ?

Thanks
Danny
Danny
www.benu.ca
Online Success Agency

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

Re: Overriding language value with spaces and variables

Post by infograf768 » Tue Sep 24, 2013 5:23 am

Please give an example of a string value, its resulting display and what you need exactly.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

iDanny
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 193
Joined: Sun Jun 08, 2008 7:56 pm
Location: Montreal
Contact:

Re: Overriding language value with spaces and variables

Post by iDanny » Tue Sep 24, 2013 11:12 am

Hi,

Here's a YooTheme Zoo example (there are many others)

ADD %S="Ajouter %s"

Danny
Danny
www.benu.ca
Online Success Agency

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

Re: Overriding language value with spaces and variables

Post by infograf768 » Sat Sep 28, 2013 8:38 am

This type of constant does not follow the way it should be done in Joomla.
It should be rather something like
ADD_WHATEVER="Ajouter %s" // where whatever can be anything desired
%s is a variable defined in code.

If an extension, whatever it is, including templates, uses a specific constant, the constant itself can't be changed in the Overrides. It has to be changed in the extension code.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

jegbertzen
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Feb 09, 2006 11:43 am

Re: Overriding language value with spaces and variables

Post by jegbertzen » Thu Jan 09, 2014 8:24 am

a lot of Zoo language strings are made with spaces, but when saving this in the override function, the space is stripped. How to add an override in this case:

http://screencast.com/t/NTu0eBSuLsW5

Maksee
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Thu Nov 20, 2008 11:21 am
Location: Moscow, Russia

Re: Overriding language value with spaces and variables

Post by Maksee » Thu Aug 02, 2018 9:05 am

A very old topic, but seems like youtheme still uses constants with spaces. According to a support reply, one should access language/overrides/{your language file}.ini and append required spaces at the left part, for example, stripped LEAVEACOMMENT to LEAVE A COMMENT. After the change, the new language constanst works. In the admin section you may see the spaced variant in the language constant table, but sure can't use joomla editor to modify it.

gws
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3493
Joined: Tue Aug 23, 2005 1:56 pm
Location: South coast, UK
Contact:

Re: Overriding language value with spaces and variables

Post by gws » Thu Aug 02, 2018 9:52 am

@Maksee . please don't necropost.

Maksee
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Thu Nov 20, 2008 11:21 am
Location: Moscow, Russia

Re: Overriding language value with spaces and variables

Post by Maksee » Thu Aug 02, 2018 10:53 am

gws wrote:
Thu Aug 02, 2018 9:52 am
@Maksee . please don't necropost.
Ok, not to begin a flame, just to clarify,
I had googled the problem [Joomla language constant with spaces]. The problem is related to the latest Joomla 3.* and latest yootheme zoo (not "necro" as you may see), the search led here. When I found a solution (not here), I imagined someone doing the same search and finding the same topic, but without a solution, so I posted one.

What's wrong with that? I will promise to acquire better web habits if you give a good argument :)

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

Re: Overriding language value with spaces and variables

Post by infograf768 » Fri Aug 03, 2018 8:22 am

The main problem is not Joomla, it is the Yootheme developers who, contrary to all tutorials since 1.6, go on using Keys with spaces instead of underscores.
Instead of finding tricks, it would be good to tell this to them once and for all.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

Maksee
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Thu Nov 20, 2008 11:21 am
Location: Moscow, Russia

Re: Overriding language value with spaces and variables

Post by Maksee » Fri Aug 03, 2018 10:28 am

infograf768 wrote:
Fri Aug 03, 2018 8:22 am
Instead of finding tricks, it would be good to tell this to them once and for all.
I agree with this wholly. Probably they're already aware and even probably most of their developers follow the rules (at least I looked at the couple of the templates and all the JText::_ calls use underscored capital letters constants).
In this case (zoo package) there might be a compatibility burden, once they introduced "bad" constants, there' s no easy way to rename them without breaking someone's language changes. In this case we have to rely on tricks at least for legacy constants.


Post Reply

Return to “Language - Joomla! 3.x”