WordPress.org

Ready to get started?Download WordPress

Forums

  1. masterbip
    Member
    Posted 4 months ago #

    Hi there. The plugin works perfect but... I want to be able to get in Spanish or other language the text, as example: "Partly Cloudy" should be to me "Parcialmente Nublado"
    I don't want to touch the core files, so ... is there a PO or language file?
    Thanks in advance!

    https://wordpress.org/plugins/wunderground/

  2. Marko Rosic
    Member
    Posted 4 months ago #

    Hi!

    Just had this problem myself recently. You should put some code in wonderground.php file, but it's nothing complicated.

    AFTER THE LINE: $label = $this->format_date($date, $todaylabel, $datelabel);
    AND BEFORE THE LINE: $tablehead .= "\n\t\t\t\t\t\t\t".'<th scope="col" width="'.$colwidth.'%" align="'.$align.'">'.$label.'</th>';

    PUT THIS CODE:
    if ( $label == 'Sunday' ) { $label = 'Nedjelja'; }
    else if ( $label == 'Monday' ) { $label = 'Ponedjeljak'; }
    else if ( $label == 'Tuesday' ) { $label = 'Utorak'; }
    else if ( $label == 'Wednesday' ) { $label = 'Srijeda'; }
    else if ( $label == 'Thursday' ) { $label = 'Četvrtak'; }
    else if ( $label == 'Friday' ) { $label = 'Petak'; }
    else if ( $label == 'Saturday' ) { $label = 'Subota'; }

    if ( $conditions == 'Clear' ) { $conditions = 'Vedro'; }
    else if ( $conditions == 'Chance of Snow' ) { $conditions = 'Moguć snijeg'; }
    else if ( $conditions == 'Chance of Rain' ) { $conditions = 'Moguća kiša'; }
    else if ( $conditions == 'Chance of Freezing Rain' ) { $conditions = 'Moguća ledena kiša'; }
    else if ( $conditions == 'Chance of Sleet' ) { $conditions = 'Moguća susnježica'; }
    else if ( $conditions == 'Chance of Thunderstorms' ) { $conditions = 'Mogućnost grmljavine'; }
    else if ( $conditions == 'Cloudy' ) { $conditions = 'Oblačno'; }
    else if ( $conditions == 'Flurries' ) { $conditions = 'Vjetrovito'; }
    else if ( $conditions == 'Fog' ) { $conditions = 'Magla'; }
    else if ( $conditions == 'Freezing Rain' ) { $conditions = 'Ledena kiša'; }
    else if ( $conditions == 'Haze' ) { $conditions = 'Sumaglica'; }
    else if ( $conditions == 'Mostly Cloudy' ) { $conditions = 'Uglavnom oblačno'; }
    else if ( $conditions == 'Mostly Sunny' ) { $conditions = 'Uglavnom sunčano'; }
    else if ( $conditions == 'Overcast' ) { $conditions = 'Oblačno'; }
    else if ( $conditions == 'Partly Cloudy' ) { $conditions = 'Djelomično oblačno'; }
    else if ( $conditions == 'Partly Sunny' ) { $conditions = 'Djelomično sunčano'; }
    else if ( $conditions == 'Rain' ) { $conditions = 'Kiša'; }
    else if ( $conditions == 'Scattered Clouds' ) { $conditions = 'Mjestimično oblačno'; }
    else if ( $conditions == 'Sleet' ) { $conditions = 'Susnježica'; }
    else if ( $conditions == 'Snow' ) { $conditions = 'Snijeg'; }
    else if ( $conditions == 'Sunny' ) { $conditions = 'Sunčano'; }
    else if ( $conditions == 'Thunderstorms' ) { $conditions = 'Grmljavina'; }
    else if ( $conditions == 'Thunderstorm' ) { $conditions = 'Grmljavina'; }
    else if ( $conditions == 'Unknown' ) { $conditions = 'Nepoznato'; }

    This should be all values. Translate it to your language and it should do the trick. This translation is for croatian.

    Hope this helps :)

    Best,
    Marko

    https://wordpress.org/plugins/wunderground/

  3. masterbip
    Member
    Posted 4 months ago #

    Aca esta para ESPAÑOL: Acepto modificaciones!

    if ( $label == 'Sunday' ) { $label = 'Domingo'; }
    else if ( $label == 'Monday' ) { $label = 'Lunes'; }
    else if ( $label == 'Tuesday' ) { $label = 'Martes'; }
    else if ( $label == 'Wednesday' ) { $label = 'Miercoles'; }
    else if ( $label == 'Thursday' ) { $label = 'Jueves'; }
    else if ( $label == 'Friday' ) { $label = 'Viernes'; }
    else if ( $label == 'Saturday' ) { $label = 'Sabado'; }

    if ( $conditions == 'Clear' ) { $conditions = 'Despejado'; }
    else if ( $conditions == 'Chance of Snow' ) { $conditions = 'Probabilidad de Nieve'; }
    else if ( $conditions == 'Chance of Rain' ) { $conditions = 'Probabilidad de Lluvia'; }
    else if ( $conditions == 'Chance of Freezing Rain' ) { $conditions = 'Probabilidad de Lluvia helada'; }
    else if ( $conditions == 'Chance of Sleet' ) { $conditions = 'Probabilidad de AguaNieve'; }
    else if ( $conditions == 'Chance of Thunderstorms' ) { $conditions = 'Probabilidad de Tormenta'; }
    else if ( $conditions == 'Cloudy' ) { $conditions = 'Nublado'; }
    else if ( $conditions == 'Flurries' ) { $conditions = 'Nieve suave'; }
    else if ( $conditions == 'Fog' ) { $conditions = 'Niebla'; }
    else if ( $conditions == 'Freezing Rain' ) { $conditions = 'Lluvia helada'; }
    else if ( $conditions == 'Haze' ) { $conditions = 'Neblina'; }
    else if ( $conditions == 'Mostly Cloudy' ) { $conditions = 'Mayormente nublado'; }
    else if ( $conditions == 'Mostly Sunny' ) { $conditions = 'Mayormente Soleado'; }
    else if ( $conditions == 'Overcast' ) { $conditions = 'Nublado con poca visibilidad'; }
    else if ( $conditions == 'Partly Cloudy' ) { $conditions = 'Parcialmente nublado'; }
    else if ( $conditions == 'Partly Sunny' ) { $conditions = 'Parcialmente Soleado'; }
    else if ( $conditions == 'Rain' ) { $conditions = 'Lluvia'; }
    else if ( $conditions == 'Scattered Clouds' ) { $conditions = 'Nubes Dispersas'; }
    else if ( $conditions == 'Sleet' ) { $conditions = 'Aguanieve'; }
    else if ( $conditions == 'Snow' ) { $conditions = 'Nieve'; }
    else if ( $conditions == 'Sunny' ) { $conditions = 'Soleado'; }
    else if ( $conditions == 'Thunderstorms' ) { $conditions = 'Tormentas electricas'; }
    else if ( $conditions == 'Thunderstorm' ) { $conditions = 'Tormenta Eléctrica'; }
    else if ( $conditions == 'Unknown' ) { $conditions = 'Desconocido'; }

  4. masterbip
    Member
    Posted 4 months ago #

    I post the translation without testing ... and is not working :-(
    ------------------
    Edit: Sorry but it worked like a charm, you only have also to disable in options "Cache forecast results"
    Thanks!!!

  5. slatbh
    Member
    Posted 3 months ago #

    Thanks Marko for this solution.

    To help others, below is a quick and dirty translation into Portuguese. Feel free to modify

    if ( $label == 'Sunday' ) { $label = 'Domingo'; }
    else if ( $label == 'Monday' ) { $label = 'Segunda'; }
    else if ( $label == 'Tuesday' ) { $label = 'Terça'; }
    else if ( $label == 'Wednesday' ) { $label = 'Quarta'; }
    else if ( $label == 'Thursday' ) { $label = 'Quinta'; }
    else if ( $label == 'Friday' ) { $label = 'Sexta'; }
    else if ( $label == 'Saturday' ) { $label = 'Sábado'; }

    if ( $conditions == 'Clear' ) { $conditions = 'Claro'; }
    else if ( $conditions == 'Chance of Snow' ) { $conditions = 'Pode nevar'; }
    else if ( $conditions == 'Chance of Rain' ) { $conditions = 'Pode chover'; }
    else if ( $conditions == 'Chance of Freezing Rain' ) { $conditions = 'Pode gear'; }
    else if ( $conditions == 'Chance of Sleet' ) { $conditions = 'Pode nevar com chuva'; }
    else if ( $conditions == 'Chance of Thunderstorms' ) { $conditions = 'Temporal'; }
    else if ( $conditions == 'Cloudy' ) { $conditions = 'Nublado'; }
    else if ( $conditions == 'Flurries' ) { $conditions = 'Flurries'; }
    else if ( $conditions == 'Fog' ) { $conditions = 'Fog'; }
    else if ( $conditions == 'Freezing Rain' ) { $conditions = 'Chuva de granizo'; }
    else if ( $conditions == 'Haze' ) { $conditions = 'Neblina'; }
    else if ( $conditions == 'Mostly Cloudy' ) { $conditions = 'Nublado'; }
    else if ( $conditions == 'Mostly Sunny' ) { $conditions = 'Sol'; }
    else if ( $conditions == 'Overcast' ) { $conditions = 'Nublado'; }
    else if ( $conditions == 'Partly Cloudy' ) { $conditions = 'Parcialmente nublado'; }
    else if ( $conditions == 'Partly Sunny' ) { $conditions = 'Parcialmente ensolarado'; }
    else if ( $conditions == 'Rain' ) { $conditions = 'Chuva'; }
    else if ( $conditions == 'Scattered Clouds' ) { $conditions = 'Nuvens escassas'; }
    else if ( $conditions == 'Sleet' ) { $conditions = 'Neve com chuva'; }
    else if ( $conditions == 'Snow' ) { $conditions = 'Neve'; }
    else if ( $conditions == 'Sunny' ) { $conditions = 'Sol'; }
    else if ( $conditions == 'Thunderstorms' ) { $conditions = 'Temporais'; }
    else if ( $conditions == 'Thunderstorm' ) { $conditions = 'Temporal'; }
    else if ( $conditions == 'Unknown' ) { $conditions = 'Desconhecido'; }

  6. Guillaume REMBERT
    Member
    Posted 3 months ago #

    There was a missing field in the translation (discovered thanks to the nice Lille weather ;) - "Chance of a Thunderstorm"

    Here is for the french translation:

    if ( $label == 'Sunday' ) { $label = 'Dimanche'; }
    else if ( $label == 'Monday' ) { $label = 'Lundi'; }
    else if ( $label == 'Tuesday' ) { $label = 'Mardi'; }
    else if ( $label == 'Wednesday' ) { $label = 'Mercredi'; }
    else if ( $label == 'Thursday' ) { $label = 'Jeudi'; }
    else if ( $label == 'Friday' ) { $label = 'Vendredi'; }
    else if ( $label == 'Saturday' ) { $label = 'Samedi'; }
    
    if ( $conditions == 'Clear' ) { $conditions = 'Dégagé'; }
    else if ( $conditions == 'Chance of Snow' ) { $conditions = 'Risques de neige'; }
    else if ( $conditions == 'Chance of Rain' ) { $conditions = 'Risques de pluie'; }
    else if ( $conditions == 'Chance of Freezing Rain' ) { $conditions = 'Risques de pluie verglaçante'; }
    else if ( $conditions == 'Chance of Sleet' ) { $conditions = 'Risques de neige fondue'; }
    else if ( $conditions == 'Chance of a Thunderstorm' ) { $conditions = 'Risques d orage'; }
    else if ( $conditions == 'Chance of Thunderstorms' ) { $conditions = 'Risques d orages'; }
    else if ( $conditions == 'Cloudy' ) { $conditions = 'Nuageux'; }
    else if ( $conditions == 'Flurries' ) { $conditions = 'Rafales de vent'; }
    else if ( $conditions == 'Fog' ) { $conditions = 'Brouillard'; }
    else if ( $conditions == 'Freezing Rain' ) { $conditions = 'Pluie verglaçante'; }
    else if ( $conditions == 'Haze' ) { $conditions = 'Brumeux'; }
    else if ( $conditions == 'Mostly Cloudy' ) { $conditions = 'Principalement nuageux'; }
    else if ( $conditions == 'Mostly Sunny' ) { $conditions = 'Principalement ensoleillé'; }
    else if ( $conditions == 'Overcast' ) { $conditions = 'Couvert'; }
    else if ( $conditions == 'Partly Cloudy' ) { $conditions = 'Partiellement nuageux'; }
    else if ( $conditions == 'Partly Sunny' ) { $conditions = 'Partiellement ensoleillé'; }
    else if ( $conditions == 'Rain' ) { $conditions = 'Pluie'; }
    else if ( $conditions == 'Scattered Clouds' ) { $conditions = 'Nuages dispersés'; }
    else if ( $conditions == 'Sleet' ) { $conditions = 'Neige fondue'; }
    else if ( $conditions == 'Snow' ) { $conditions = 'Neige'; }
    else if ( $conditions == 'Sunny' ) { $conditions = 'Ensoleillé'; }
    else if ( $conditions == 'Thunderstorms' ) { $conditions = 'Orages'; }
    else if ( $conditions == 'Thunderstorm' ) { $conditions = 'Orage'; }
    else if ( $conditions == 'Unknown' ) { $conditions = 'Inconnu'; }

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

  7. slc0295
    Member
    Posted 3 months ago #

    Hi all!

    I add also finnish translation to use in all projects.

    Thanks for this plugin, it looks great and is easy to use.

    AFTER THE LINE: $label = $this->format_date($date, $todaylabel, $datelabel);
    AND BEFORE THE LINE: $tablehead .= "\n\t\t\t\t\t\t\t".'<th scope="col" width="'.$colwidth.'%" align="'.$align.'">'.$label.'</th>';
    PUT THIS CODE:
    if ( $label == 'Sunday' ) { $label = 'Sunnuntai'; }
    else if ( $label == 'Monday' ) { $label = 'Maanantai'; }
    else if ( $label == 'Tuesday' ) { $label = 'Tiistai'; }
    else if ( $label == 'Wednesday' ) { $label = 'Keskiviikko'; }
    else if ( $label == 'Thursday' ) { $label = 'Torstai'; }
    else if ( $label == 'Friday' ) { $label = 'Perjantai'; }
    else if ( $label == 'Saturday' ) { $label = 'Lauantai'; }
    if ( $conditions == 'Clear' ) { $conditions = 'Selkeää'; }
    else if ( $conditions == 'Chance of Snow' ) { $conditions = 'Mahdollisesti lumisade'; }
    else if ( $conditions == 'Chance of Rain' ) { $conditions = 'Mahdollisesti sadetta'; }
    else if ( $conditions == 'Chance of Freezing Rain' ) { $conditions = 'Mahdollisesti alijäähtynyttä vettä'; }
    else if ( $conditions == 'Chance of Sleet' ) { $conditions = 'Mahdollisesti räntää'; }
    else if ( $conditions == 'Chance of Thunderstorms' ) { $conditions = 'Mahdollisesti ukkoskuuroja'; }
    else if ( $conditions == 'Cloudy' ) { $conditions = 'Pilvistä'; }
    else if ( $conditions == 'Flurries' ) { $conditions = 'Lumikuuroja'; }
    else if ( $conditions == 'Fog' ) { $conditions = 'Sumua'; }
    else if ( $conditions == 'Freezing Rain' ) { $conditions = 'Jäätävä tihku'; }
    else if ( $conditions == 'Haze' ) { $conditions = 'Usva'; }
    else if ( $conditions == 'Mostly Cloudy' ) { $conditions = 'Pilvistä'; }
    else if ( $conditions == 'Mostly Sunny' ) { $conditions = 'Aurinkoista'; }
    else if ( $conditions == 'Overcast' ) { $conditions = 'Pilvistä'; }
    else if ( $conditions == 'Partly Cloudy' ) { $conditions = 'Osittain pilvistä'; }
    else if ( $conditions == 'Partly Sunny' ) { $conditions = 'Osittain aurinkoista'; }
    else if ( $conditions == 'Rain' ) { $conditions = 'Sadetta'; }
    else if ( $conditions == 'Scattered Clouds' ) { $conditions = 'Hajanaisia pilviä'; }
    else if ( $conditions == 'Sleet' ) { $conditions = 'Räntää'; }
    else if ( $conditions == 'Snow' ) { $conditions = 'Lunta'; }
    else if ( $conditions == 'Sunny' ) { $conditions = 'Aurinkoista'; }
    else if ( $conditions == 'Thunderstorms' ) { $conditions = 'Ukkostaa'; }
    else if ( $conditions == 'Thunderstorm' ) { $conditions = 'Ukkosta'; }
    else if ( $conditions == 'Unknown' ) { $conditions = 'Tuntematon'; }

  8. porga
    Member
    Posted 3 weeks ago #

    Is there a solution to add a conditional language recognition in case website is multilingual?
    For example to use like this (which I tried for multilingual 404 error message, with polylang plugin.):

    <?php $jez=pll_current_language();
    switch ($jez) {
        case "en":
            echo "EN 404";
            break;
        case "hr":
            echo "HR 404";
            break;
        case "de":
            echo "DE 404";
            break;
        case "it":
            echo "IT 404";
            break;
    }?>

    Just remove echo statement with set of commands for required language. Or maybe eve rewrite code to use nested switch? I will try this tomorrow. Thanks to the author for the solution.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.