3in1/ plaintext description for sleet

Hi,

I have noticed that the description in the 3in1 forecast for sleet is shown as ‘mix of rain and snow’. This seems to be coming from the plaintext.txt file. I was wondering if there was any way to change it to say sleet. My plaintext-parser-lang-en.txt already has ‘langlookup|Rain and Snow|Sleet|’, but it still says ‘mix of rain and snow’. Can this be changed in anyway?

From what I understand from the script is that no translation is required if the language is en. Your translation file is therefore not being used and therefore changes made will have no effect on the output. Look at the first few lines within wxall.plaintext.php and you will translation only if language <>en

What concerns me is that if the language is default at en, the script generates a lot of php warnings in an error log file on the Web host.

Sent from my GT-I9300 using Tapatalk 2

Hi,

I have checked wxall.plaintext.php and the language is set to ‘en’.

This is a copy of the section from the wxall.plaintext.php file:

// load the config file
$config = file($plaintextfolderfull.“plaintext-parser-data.txt”); //
// load and merge the language file (if it exists)
if ($lang <> ‘en’ and file_exists($plaintextfolderfull.“plaintext-parser-lang-$lang.txt”) ) {
$doTranslate = true;
$lfile = file($plaintextfolderfull.“plaintext-parser-lang-$lang.txt”);
foreach ($lfile as $val) {
array_push($config,$val);
}
$Status .= “\n”;
if (strpos($UTFLang,$lang) > 0) {$useCharSet = ‘UTF-8’; $Status .= “\n”;}
} else {
$doTranslate = false;
if($lang <> ‘en’) {
$Status .= “\n”;
$lang = ‘en’;
}
}

Is there any way of finding out if it is using the language file?

Trust me it’s not. <> means "if it is anything other than en else no translation. "

Sent from my GT-I9300 using Tapatalk 2

Well it is not using the en language file because of the line
if ($lang <> ‘en’ and file_exists($plaintextfolderfull.“plaintext-parser-lang-$lang.txt”) ) {
which says If the language used is NOT EQUAL to english check if there is a file.
To test that it is not using any ‘en’ language file, simply copy the finnish language file and give it the english language file name. Now all output should be in Finnish, but when you do the test all output stays in English, not a word Finnish will appear.

The solution for you:
Because the word “frost” means something different here in continental Europe than in the US I had to change some of the English terms also. So I ran into the same problem and had to change that code line and added two other lines.
# Translations, borrowed from Ken’s plaintext-parser :wink:
$doTranslate = true; // if you do not want ANY translation set to false #### added
// load the config file
$config = file($plaintextfolderfull.“plaintext-parser-data.txt”); //
// load and merge the language file (if it exists)
#if ($lang <> ‘en’ and file_exists($plaintextfolderfull.“plaintext-parser-lang-$lang.txt”) ) { #### commented
if ($doTranslate and file_exists($plaintextfolderfull.“plaintext-parser-lang-$lang.txt”) ) { #### added

Everything works like it should be.
I enclose a zip containing an plaintext-parser-lang-en.txt with all sentences and words as I am aware off.
And a readme with more or less the same text as in this posting.

Succes, Wim


plaintext-en.zip (4.33 KB)