NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 16 17 18 19 20 … 93 Next »
Translations

 
  • 0 Vote(s) - 0 Average
Translations
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#1
2011-03-16, 08:23 PM
I see there is a LanguageServices class in the API. Does anyone have any hints on how to use it, and how to arrange files containing strings etc? (or a pointer to a plugin that already does some of this?)

That's assuming of course that we're meant to use it for translations? I've done i18n stuff often enough with Java, but don't have a clue where to begin with c#.

Iain
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,727
Threads: 767
Joined: Nov 2003
#2
2011-03-17, 12:26 AM
From a plugin's perspective, its mostly automatic. ie, anytime the app goes to display a string, whether it was a hardcoded one in a skin file, or something the plugin has created with the skinHelper class, the app will look for a translation of that string in the current language file. About the only time you need to manually translate something with the LanguageServices class, is when you're making up some composite string that is likely to change a bit.

ie, instead of doing something like:

args["@randomNumber"] = "todays random number is: " + Math.Rand(1234567):

Since that'd end up with some string the app wont find a translation for, you might do this instead:

args["@randomNumber"] = LanguageServices.GetInstance().GetTranslation("todays random number is:") + " " + Math.Rand(1234567):
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,727
Threads: 767
Joined: Nov 2003
#3
2011-03-17, 12:28 AM
I do not supply a master list of strings though. Its up to users to provide their own translations. It can be configured to capture a file of strings it attempts to translate though, giving the user a language file ready for them to fill in the gaps.
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#4
2011-03-17, 03:47 PM
Thanks sub, that helps a bit.

I'm still a little fuzzy over how to test anything though. For example, my install seems to have a Languages\Danish.xml file with a couple of sample strings in it. I couldn't work out how to get any of them to display though. Changing the Location in "Region and Language" in control panel didn't seem to let it pick it up.

Another question, and assuming a plugin did want to bundle its set of translations. How should it do this? With a single xml file per language as it appears to be, I can't see how a new plugin could easily integrate its translations into an existing whereever.xml file? Unless you had something like klingon.xml and then PluginName-klingon.xml and so on.

Iain
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,727
Threads: 767
Joined: Nov 2003
#5
2011-03-17, 04:03 PM
imilne Wrote:I'm still a little fuzzy over how to test anything though. For example, my install seems to have a Languages\Danish.xml file with a couple of sample strings in it. I couldn't work out how to get any of them to display though. Changing the Location in "Region and Language" in control panel didn't seem to let it pick it up.
On the Settings -> General screen, you can use the Language setting to choose from any available translation files.

Quote:Another question, and assuming a plugin did want to bundle its set of translations. How should it do this? With a single xml file per language as it appears to be, I can't see how a new plugin could easily integrate its translations into an existing whereever.xml file? Unless you had something like klingon.xml and then PluginName-klingon.xml and so on.
That's just the way it is. The single file per language worked pretty well for GBPVR, so I wanted to stick with the same model. If you've got multiple files, you'll find people doing the translations wont bother doing your plugin because they're not personally using it.
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#6
2011-03-17, 04:41 PM
sub Wrote:On the Settings -> General screen, you can use the Language setting to choose from any available translation files.
I'd looked there too. Couldn't see the wood for the trees Big Grin

sub Wrote:That's just the way it is.

No no, it's fine, I didn't intend anything as a criticism, I was just trying to suss out how things would work.

Thanks again.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode