Escaped apostrophes in language constants Topic is solved
Moderator: wendhausen
- dyfrig
- Joomla! Enthusiast
- Posts: 136
- Joined: Thu Nov 20, 2008 9:07 pm
- Location: Cymru/Wales
Escaped apostrophes in language constants
I have noticed recently that a lot of the newer source language strings in J4 have apostrophes represented by escaped characters to avoid confusion with single quotes. Welsh does not use this symbol for possession as in English but does make very extensive use of it to represent missing letters in contractions (cf "their's" for "there is" in English) so it would be laborious to enter the escape character for all such cases. It wasn't done until recently. I'm wondering whether it's really necessary?
Last edited by toivo on Fri Feb 11, 2022 10:15 pm, edited 1 time in total.
Reason: mod note: retitled on request
Reason: mod note: retitled on request
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Escaped Apostrophes
Yes, double quotes have to be escaped. Otherwise the whole ini file will not load.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
- dyfrig
- Joomla! Enthusiast
- Posts: 136
- Joined: Thu Nov 20, 2008 9:07 pm
- Location: Cymru/Wales
Re: Escaped Apostrophes
Thanks JM but I was asking about single quotes. They weren't usually escaped but now seem to be in the newest files for 4.1.
-
- I've been banned!
- Posts: 13639
- Joined: Sun Jul 05, 2009 3:30 am
- Location: Canberra, Australia
Re: Escaped Apostrophes in language constants
Single quotes don't need to be escaped in J!.
example:
Code: Select all
COM_CONFIG_TEXT_FILTERS_NOTE="WARNING: You have configured a parent group with the setting 'No Filtering' - this setting can't be overridden in child groups and any other configured filter will not be applied."
I don't know anything about a change to the syntax for J! 4.1. You may want to ask the developers (at GitHub) if they've changed the syntax? I can't find any case reported to the developers that relates to your question, sorry.
- Webdongle
- Joomla! Master
- Posts: 44070
- Joined: Sat Apr 05, 2008 9:58 pm
Re: Escaped apostrophes in language constants
Theirs = belonging to them
There's = there is
https://docs.joomla.org/Creating_a_lang ... ition_file (last updated march last year)
The value should always be surrounded by double-quote characters ("), as in the example. The value itself cannot include double-quote characters, although single-quote characters (') are valid. Use \, including the double quotes, to place a double-quote character in your value. For example, to attach the value <span class="red">Warning!</span> to the key WARNING_TEXT, use following line
WARNING_TEXT="<span class=\"red\">Warning!</span>"
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
-
- I've been banned!
- Posts: 13639
- Joined: Sun Jul 05, 2009 3:30 am
- Location: Canberra, Australia
Re: Escaped apostrophes in language constants
That is my understanding, too. Single-quotes (or apostrophes) do not need to be escaped. As I wrote before, if the rules have changed with J! 4.1 then I haven't read about this anywhere.Webdongle wrote: ↑Fri Feb 11, 2022 10:48 pmhttps://docs.joomla.org/Creating_a_lang ... ition_file (last updated march last year)The value should always be surrounded by double-quote characters ("), as in the example. The value itself cannot include double-quote characters, although single-quote characters (') are valid.
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Escaped apostrophes in language constants
Apostrophes ’ (also called curly apostrophes i.e. ’ or ’) as well as single quotes ' don't need to be escaped, J4 or not.
And I do not understand why this string contains escaped single quotes: imho it is a mistake and should be corrected...
administrator/language/en-GB/plg_system_jooa11y.ini:83:
PLG_SYSTEM_JOOA11Y_LINK_URL="Longer, less intelligible URLs used as link text might be difficult to listen to with assistive technology. In most cases, it is better to use human-readable text instead of the URL. Short URLs (such as a site\'s homepage) are okay."
And I do not understand why this string contains escaped single quotes: imho it is a mistake and should be corrected...
administrator/language/en-GB/plg_system_jooa11y.ini:83:
PLG_SYSTEM_JOOA11Y_LINK_URL="Longer, less intelligible URLs used as link text might be difficult to listen to with assistive technology. In most cases, it is better to use human-readable text instead of the URL. Short URLs (such as a site\'s homepage) are okay."
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
- dyfrig
- Joomla! Enthusiast
- Posts: 136
- Joined: Thu Nov 20, 2008 9:07 pm
- Location: Cymru/Wales
Re: Escaped apostrophes in language constants
Thanks everybody. You have confirmed what I thought i.e. that escaping the single quotes wasn't neccessary. I'll stick to the non-escaped characters in my translations.
For what it's worth I've done a search through the source files and found 3 examples - the one JM quoted (line 83)and also lines 63 and 91. It's fewer than I had thought.
Line 63: PLG_SYSTEM_JOOA11Y_PANEL_STATUS_12="The item you are trying to view is not visible; it may be hidden or inside of an accordion or tab component. Here\'s a preview="
Line 91: PLG_SYSTEM_JOOA11Y_NEW_TAB_WARNING="Link opens in a new tab or window without warning. Doing so can be disorienting, especially for people who have difficulty perceiving visual content. Secondly, it is not always a good practice to control someone\'s experience or make decisions for them. Indicate that the link opens in a new window within the link text."
For what it's worth I've done a search through the source files and found 3 examples - the one JM quoted (line 83)and also lines 63 and 91. It's fewer than I had thought.
Line 63: PLG_SYSTEM_JOOA11Y_PANEL_STATUS_12="The item you are trying to view is not visible; it may be hidden or inside of an accordion or tab component. Here\'s a preview="
Line 91: PLG_SYSTEM_JOOA11Y_NEW_TAB_WARNING="Link opens in a new tab or window without warning. Doing so can be disorienting, especially for people who have difficulty perceiving visual content. Secondly, it is not always a good practice to control someone\'s experience or make decisions for them. Indicate that the link opens in a new window within the link text."
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Escaped apostrophes in language constants
I suggest you create an issue about these.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
- Webdongle
- Joomla! Master
- Posts: 44070
- Joined: Sat Apr 05, 2008 9:58 pm
Re: Escaped apostrophes in language constants
And post a link to the issue here please.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
- dyfrig
- Joomla! Enthusiast
- Posts: 136
- Joined: Thu Nov 20, 2008 9:07 pm
- Location: Cymru/Wales
Re: Escaped apostrophes in language constants
I had never created an issue on GitHub before but I've had a go. Hope it's OK. https://issues.joomla.org/tracker/joomla-cms/37024
- pishro
- Joomla! Explorer
- Posts: 301
- Joined: Tue Oct 09, 2012 7:22 am
Re: Escaped apostrophes in language constants
Thanks to my good friends.
What do you think about this article?
https://issues.joomla.org/tracker/joomla-cms/5907
What do you think about this article?
https://issues.joomla.org/tracker/joomla-cms/5907