joomla-projects / com_localise

forked version of the original com_localise for experimental purposes
GNU General Public License v2.0
24 stars 36 forks source link

Is hash key symbol (#) allowed in Joomla language key? #312

Open joomlagate opened 8 years ago

joomlagate commented 8 years ago

Steps to reproduce the issue

open the backend language file of Easyblog component:

filename: en-GB.plg_easyblog_pagebreak.ini , line 13 is:

PLG_PAGEBREAK_PAGE_#="Page %s" When translating this file with localise v4.0.21dev, localise component will show warning message that this line is wrong: the "#" symbol (AKA "Number Sign") should NOT in a language key.

System information (as much as possible)

Joomla 3.6.2 PHP 7.0 localise v4.0.21dev

Additional comments

I am not sure if hash symbol (#) is allowed in Joomla language key? If not, this is a bug of Easyblog; if yes, this is a bug of com_localise.

Thank you.

mbabker commented 8 years ago

As of 3.6.3 you can run JFactory::getLanguage()->debugFile($filename); and that will tell you if the file passes core's rules (this is the same debug code that runs in 3.6.2 and earlier when the file is parsed but now made available as a separate public API).

The line format is expected to pass https://github.com/joomla/joomla-cms/blob/3.6.3-rc1/libraries/joomla/language/language.php#L932

joomlagate commented 8 years ago

Can you just confirm that if the following line is correct or wrong ( because com_localise reported it as error) :

PLG_PAGEBREAK_PAGE_#="Page %s"

mbabker commented 8 years ago

I don't know, I can't regex my way out of a wet brown paper bag.