LanguageHandler question
-
Hi all,
Why is this not working ?$tStrings = LanguageHandler.new("Components.strings")
And this is working:
$tStrings = LanguageHandler.new("sandbox.strings")
All other ".strings" files work, except this one. All are at the correct location.
The message I get is the following:@unknownuser said:
Error: #<NoMethodError: C:/PROGRA~1/Google/GOOGLE~4/Tools/LangHandler.rb:72:in
ParseLangFile': private method
gsub!' called for nil:NilClass>In LanguageHandler.rb, the line 72 is:
keyvalue[1].gsub!(";", "")
So keyvalue[1] seems to be nil, but in reverse exploring the code, I can't see what's wrong with the file.
All usual functions of this file work OK: components names are in french in the component browser and so on...
Any idea someone ?
Attached in the french components.strings file if you want to try it.
Put it in your Resources/local_name folder
(make a backup of yours first) -
Try adding these 3 lines to the Langhandler.rb code.
(The last 3 on the left)#pull out the key keyvalue = entryString.split("\"=\"") $keyvalue = keyvalue $entryString = entryString printf("'%s' '%s' '%s'\n", entryString, keyvalue[0], keyvalue[1])
This will print out how it splits the entryString.
and the two $variables let you examine whatever the last values were when it failed.
It turns out that it fails on the line: "-- Runtime --" = "-- Durée d'exécution --";
and the reason it fails, it because it is looking for: "=", and this line has: " = "
(spaces around the equals signs.) -
Yep, that's it !
@unknownuser said:
the reason it fails, it because it is looking for: "=", and this line has: " = "
Thanks Al. I was thinking that the strip method didn't care of spaces, and it does in fact.
Since components.strings is the stock file that is installed with the french package of GSU: to SU Team
Advertisement