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.
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 $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.