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 methodgsub!' 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 
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginAdvertisement