Need to add plurar options
Moderator: 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.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
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.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
-
- Joomla! Enthusiast
- Posts: 143
- Joined: Wed Jan 01, 2014 11:39 pm
- Location: SLOVAKIA
- Contact:
Need to add plurar options
Hi, I try to have dating site is Slovak and I have subscription for 3,6 and 12 months.
In English is plurar "months" but in Slovak we have to options "mesiace" and mesiacov
I tried to add two lines to sk-SK.com_lovefactory.ini but it didnt work. Could you please help me? THANK YOU
(original line)
COM_LOVEFACTORY_MEMBERSHIPS_PRICE_MONTHS_3="%d mesiace"
(added lines)
COM_LOVEFACTORY_MEMBERSHIPS_PRICE_MONTHS_6="%d mesiacov"
COM_LOVEFACTORY_MEMBERSHIPS_PRICE_MONTHS_12="%d mesiacov"
In English is plurar "months" but in Slovak we have to options "mesiace" and mesiacov
I tried to add two lines to sk-SK.com_lovefactory.ini but it didnt work. Could you please help me? THANK YOU
(original line)
COM_LOVEFACTORY_MEMBERSHIPS_PRICE_MONTHS_3="%d mesiace"
(added lines)
COM_LOVEFACTORY_MEMBERSHIPS_PRICE_MONTHS_6="%d mesiacov"
COM_LOVEFACTORY_MEMBERSHIPS_PRICE_MONTHS_12="%d mesiacov"
Joomla amateur but Enthusiast and Lover
Attendant of J and Beyond 2015 in Prague
Im beekeeper, I love honey and bees http://www.medaren.sk
Attendant of J and Beyond 2015 in Prague
Im beekeeper, I love honey and bees http://www.medaren.sk
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Need to add plurar options
This depends on the code used to display these strings.
It should be a JText::plural('THE_STRING')
With strings similar to (for English)
COM_MESSAGES_N_ITEMS_DELETED="%d messages successfully deleted."
COM_MESSAGES_N_ITEMS_DELETED_1="Message successfully deleted."
BUT the slovak language pack does not contain the necessary code in
sk-SK.localise.php (site)
It has
which means that 3, 6 and 12 are not taken care of.
It should be a JText::plural('THE_STRING')
With strings similar to (for English)
COM_MESSAGES_N_ITEMS_DELETED="%d messages successfully deleted."
COM_MESSAGES_N_ITEMS_DELETED_1="Message successfully deleted."
BUT the slovak language pack does not contain the necessary code in
sk-SK.localise.php (site)
It has
Code: Select all
public static function getPluralSuffixes($count)
{
if ($count == 0)
{
$return = array('0');
}
elseif ($count == 1)
{
$return = array('1');
}
else
{
$return = array('MORE');
}
return $return;
}
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Enthusiast
- Posts: 143
- Joined: Wed Jan 01, 2014 11:39 pm
- Location: SLOVAKIA
- Contact:
Re: Need to add plurar options
Hi Infograf768, I think I understand. Could you please write me, how to change it in the way, that it will work fine for me? THANK YOU
Milan
Milan
Joomla amateur but Enthusiast and Lover
Attendant of J and Beyond 2015 in Prague
Im beekeeper, I love honey and bees http://www.medaren.sk
Attendant of J and Beyond 2015 in Prague
Im beekeeper, I love honey and bees http://www.medaren.sk
-
- Joomla! Enthusiast
- Posts: 143
- Joined: Wed Jan 01, 2014 11:39 pm
- Location: SLOVAKIA
- Contact:
Re: Need to add plurar options
I tried to change sk-SK.localise.php in following way:
if ($count == 0)
{
$return = array('0');
}
elseif ($count == 1)
{
$return = array('1');
}
else
{
$return = array('3');
}
else
{
$return = array('MORE');
}
return $return;
Parse error: syntax error, unexpected '{', expecting '(' in /home/medaren3/public_html/laskanadzlato.sk/language/sk-SK/sk-SK.localise.php on line 40 - that is line that I added...of course...Could you please help me with correction please?
if ($count == 0)
{
$return = array('0');
}
elseif ($count == 1)
{
$return = array('1');
}
else
{
$return = array('3');
}
else
{
$return = array('MORE');
}
return $return;
Parse error: syntax error, unexpected '{', expecting '(' in /home/medaren3/public_html/laskanadzlato.sk/language/sk-SK/sk-SK.localise.php on line 40 - that is line that I added...of course...Could you please help me with correction please?
Joomla amateur but Enthusiast and Lover
Attendant of J and Beyond 2015 in Prague
Im beekeeper, I love honey and bees http://www.medaren.sk
Attendant of J and Beyond 2015 in Prague
Im beekeeper, I love honey and bees http://www.medaren.sk
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Need to add plurar options
You can't have 2 else. One has to be an elseif, then the last one will be an else.
What is the condition for 3 ? I guess count==3
In that case the code will be
What is the condition for 3 ? I guess count==3
In that case the code will be
Code: Select all
public static function getPluralSuffixes($count)
{
if ($count == 0)
{
$return = array('0');
}
elseif ($count == 1)
{
$return = array('1');
}
elseif ($count == 3)
{
$return = array('3');
}
else
{
$return = array('MORE');
}
return $return;
}
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Enthusiast
- Posts: 143
- Joined: Wed Jan 01, 2014 11:39 pm
- Location: SLOVAKIA
- Contact:
Re: Need to add plurar options
Thank you very much infograf768, it worked for me as you wrote the code. THANKS!
Joomla amateur but Enthusiast and Lover
Attendant of J and Beyond 2015 in Prague
Im beekeeper, I love honey and bees http://www.medaren.sk
Attendant of J and Beyond 2015 in Prague
Im beekeeper, I love honey and bees http://www.medaren.sk
-
- Joomla! Enthusiast
- Posts: 143
- Joined: Wed Jan 01, 2014 11:39 pm
- Location: SLOVAKIA
- Contact:
Re: Need to add plurar options
Hallo infograf768,
I did write code as you helped me, but If I upgrade my extension, sk-SK.localise.php is rewrited and I have to use your code again. Is it somehow possible to save it in the way, that If I upgrade my extension, changes in sk-SK.localise.php stay as I wrote it.
Thank you very much
I did write code as you helped me, but If I upgrade my extension, sk-SK.localise.php is rewrited and I have to use your code again. Is it somehow possible to save it in the way, that If I upgrade my extension, changes in sk-SK.localise.php stay as I wrote it.
Thank you very much
Joomla amateur but Enthusiast and Lover
Attendant of J and Beyond 2015 in Prague
Im beekeeper, I love honey and bees http://www.medaren.sk
Attendant of J and Beyond 2015 in Prague
Im beekeeper, I love honey and bees http://www.medaren.sk
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Need to add plurar options
You better contact the sk-SK Translation Coordinator and discuss with him:
http://forum.joomla.org/memberlist.php? ... e&u=341717
http://forum.joomla.org/memberlist.php? ... e&u=341717
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group