Hi Luis D.,
As I am seeing you have installed spanish language but make sure the country language file of jomsocial "en-GB.com_community.country.ini" is there with appropriate language prefix.
The language file should be placed at root/language/es-ES/es-ES.com_community.country.ini"
Thanks
Hi Luis D.,
I am seeing the country list are showing as alphabetical order as it is intended.
Thanks
Hi Countries,
Sorry for the delay.
I didn't get your point.
Can you explain a bit more?
Thanks
Good morning, I explain.
To organize the countries alphabetically, I tried from ES.com_community.country.ini is-as I had recommended, but that did not affect the order and return it back to its origin, but it is a problem that "España" want to include your country is Spain, a country starting from "E" and containing an "Ñ" that is not usually translate Spanish to be a typical letter, have to rummage through the entire list to find Spain. I need to organize that list, how I can do?
Hi Luis,
that because countries sorting depending on the order with language it self. /language/en-GB/en-GB.com_community.country.ini
If you want automatically sorting. you can use this custom code:
/components/com_community/libraries/fields/country.php
line 64 ( after $countries = $parser->countries;)
$countryList = array();
for($a=0;$a<count($countries->country);$a++ )
{
$countryList["'".$countries->country[$a]->name."'"] = JText::_($countries->country[$a]->name);
}
function compareASCII($a, $b) {
$at = iconv('UTF-8', 'ASCII//TRANSLIT', $a);
$bt = iconv('UTF-8', 'ASCII//TRANSLIT', $b);
return strcmp($at, $bt);
}
uasort($countryList, 'compareASCII');
replace lines 70 - 79:
from
<?php
for($a=0;$a<count($countries->country);$a++ )
{
$name = $countries->country[$a]->name;
?>
<option value="<?php echo $name;?>"<?php echo ($field->value == $name) ? ' selected="selected"' : '';?>><?php echo JText::_($name);?></option>
<?php
}
?>
to
<?php
foreach ($countryList as $key => $value)
{
$name = str_replace("'", "", $key);
?>
<option value="<?php echo $name;?>"<?php echo ($field->value == $name) ? ' selected="selected"' : '';?>><?php echo JText::_($name);?></option>
<?php
}
?>