Translating RO5
Pages: 1 2
James Wheeler (3283) 344 posts |
Having RO5 in English is fine, but honestly it’s driving me a little nuts, and I’m eager to translate it for personal use. !Territory showed some promise, but it looks obsolete and appears to have been deleted on cvs. Also, I do need it to be an ARMv7 solution. Is this a case of me having to trawl through code editing strings? That would be a nightmare of work and would be ruined when the RO version comes out. I had heard whispers about the ROM being able to support multiple locales. Any help appreciated. |
Martin Avison (27) 1494 posts |
AFAIK !Territory is just a directory structure. To use it the contents must be as specified in the PRM section on The Territory Manager. It can include a Territory module for the country, and also replacement messages files. CVS includes modules for several countries – and they are available pre-built in the Bonus Binaries doenload. You can create replacement messages files that can replace most of the files used by ROM modules and Apps. Note that if your machine uses EtherUSB to communicate, you need a recent ROM to avoid Boot problems. What country are you in? There have been many posts on the subject of how this could or should be changed, but as yet none have come to fruition. |
James Wheeler (3283) 344 posts |
UK.
I took a wrong turn, I guess.
I am less concerned about changing it and more concerned about translating it. I’m starting to feel like altering territory isn’t the way to go, since most of the UK stuff I’d keep as is. |
Martin Avison (27) 1494 posts |
I am now confused and do not understand what you are wanting to do! |
James Wheeler (3283) 344 posts |
Translate RO. So all menu’s and such aren’t in English. |
Chris Mahoney (1684) 2165 posts |
I believe that for Toolbox-based apps you can create an additional Res file for each territory. For example, for French, you’d copy Res to Res6 and change all the text to French using ResEd. There’s also a Messages file in there somewhere but I’m not sure how that works :) Territory numbers are here but do not necessarily correspond with reality. That list also seems to be incomplete, for example one of the files in CVS has Maori in territory 37, but there’s no mention of it on that page. |
James Wheeler (3283) 344 posts |
Wow, this project is getting bigger and bigger. I guess I’d have to create a UK2. Wouldn’t it be a problem creating a random territory number that only I would use? I might not have a choice, but would make things harder compiling upgrades if more official territories are added. |
James Wheeler (3283) 344 posts |
I was wrong. I was confusing the assembly file with the resource file, I will most certainly have to make changes. I fear Territory wont do the level of translation I’m after. Is a lot of RO display text embedded in the code? How do I go about translating wimp and other built-in RO apps? |
Steffen Huber (91) 1953 posts |
Apps: it depends. Toolbox apps need their Res file translated, “standard” WIMP apps need their Templates translated. Usually apps have Messages files. Some have a special message file for their menu structure. WIMP/RO: have a look at “Resources:$” – if you don’t want to build a whole new Territory, you can change a lot of things by adjusting the resources path and providing your own templates and messages for stuff. |
Steve Drain (222) 1620 posts |
I have to point out a category error here. ;-) As such, there is no ‘RISC OS’ to translate in the way you seem to assume. What you see on the desktop is a collection of co-operating applications and OS components, each of which provides its own ‘menus and such’, including the Wimp itself. Most apps written in the recent past put most of their text items in a ‘Messages’ file, and all Toolbox apps do 1. If an application attempts to be international, it will have provision for using Messages files in different languages, but there is no universal way to do this – I will leave out the details here. Operating system components, rom applications and some soft-loaded applications and modules put their Messages file in the Resources filing system, which you can look at by clicking Menu on the Apps icon on the iconbar – look in the ‘Resources’ directory. It is possible to replace the files in Resources with your own, but that requires using a special module, or perhaps my RFSFiles module. You will notice that there is an awful lot of such files. ;-) For each of the individul apps that you use, you will need to find out if they are designed to be international and then provide a new Messages file approriately. The alternative of just replacing an English file raises some horrific complications. The appropriate Territory module, either in ROM or softloaded, provides some international features that can be called upon by any app, but the way it ties to actual languages is not well specified, eg: there are 4 territories defined for Switzerland for the four languages but the UK territory has to be English. As Martin says, this topic goes back a long time. ;-) After discussion with Martin, I have programmed a ‘proof of concept’ replacement for the way territories and languages are handled that is much closer to Windows’ Locale and Language. It is backward compatible, but bringing it to completion would be a lot of work, and I fear that with the limited amount of current development the effort would not be worth while. Existing apps would not be changed. Good luck. 1 The process of creating new Toolbox messages is slightly more complex than a direct replacement. |
Rick Murray (539) 13840 posts |
Inside apps there is usually a directory such as “UK” which holds the language specific stuff. Out of interest, what language are you wanting to support? |
Steve Drain (222) 1620 posts |
Thanks Steffen. I had forgotten that many apps still have Templates with text, although it is not strictly necessary. The replacement of Res file text involves exporting/importing them as messages, a feature that would have been improved if you could use tokens in the Res file. |
James Wheeler (3283) 344 posts |
I’m interpreting this to mean there is no standardisation. I’m obviously aware that I can’t translate everything and I’m well aware the an OS consists of many components. By “translating RO” I mean a very base vanilla RO5 install. (ROM + HD4) |
Rick Murray (539) 13840 posts |
There is standardisation. The “old” (very common) way using Messages files and Templates files (as necessary) or the “new” way using Resource files. ROM counts for around 110 or so modules. HD4 is numerous applications. Each needing their own bit of TLC. Don’t forget there are more modules than obvious, such as BCMVideo specific to the Pi, OMAPvideo specific to the Beagle (etc), and so on… |
James Wheeler (3283) 344 posts |
This is not my first rodeo. I’ve translateda few things, the last being FFOS/B2GOS I believe and I’m well aware of the amount of worked required. T.T What I need is pointing in the right direction. “Read this document,” “look for this file” etc… As I understand it, I need to look for resource and messages files? |
Rick Murray (539) 13840 posts |
There are? I thought the problem was “Switzerland” was just a single country, with no real understanding of the multiple language issue. Ditto Belgium. UK, at least, is supposed to have Wales as a separate country (as clearly Wales isn’t a part of the UK…?). Maybe in concession, they added a Wales2 country so one can choose which side of the River Taf…. :-) That said, there is no source for Territory modules for either Switzerland or Belgium (but we have for South Africa and Turkey). Maybe somebody realised that it simply wasn’t going to work (what language?!)…? |
Rick Murray (539) 13840 posts |
Hmmm… …castle.RiscOS.Sources.Internat.Territory.Manager.Resources.France.Messages Starts off okay: T1:GB T4:Italie T5:Espagne T6:France T7:Allemagne T8:Portugal T9:Esperanto T10:Grèce T11:Suède T12:Finlande T14:Danemark T15:Norvège but soon turns into this: #{DictTokens} UnkTerr:Unknown territory number UnkAlph:Unknown alphabet number UnkSub:Unsupported subreason Custom:Custom NoTerr:Territory not present BadTime:Bad time values NoRule:No rule for given timezone What? Why aren’t these in French too? It’s not just France – look at any of the non-English resources. As everybody says, this has gone back a long time. |
James Wheeler (3283) 344 posts |
Looks like it’s not worth it, which is disappointing. |
Dave Higton (1515) 3526 posts |
James, you haven’t said what you would like to translate to.
Maybe instead of an “all or nothing” approach, you could regard it as an effort to which you could make a contribution – i.e. something is better than nothing – partly for its own sake, but also in that it might enthuse other contributors to add their contributions? |
James Wheeler (3283) 344 posts |
I would never discourage someone from translating, I mean it may not be worth it for me. I’m incredibly bad at code-switching so all or nothing would really be ideal, but I may just try and do what I can. The language would be for personal use since I’m the only person that can speak it in the world, so no point submitting my contribution of getting a territory code add just for me. |
Steve Fryatt (216) 2105 posts |
I’m not quite sure how you got there? There could be a lot of work to do, depending on your target language, but you don’t need to do it all at once. RISC OS handles language support via Messages files (text files containing tokens and messages), Templates, Resources, and other voodoo dreamt up by individual programmers. I think that the OS holds most of its language-specific stuff in the Resources filing system, so you can replace these files to suit yourself. I’m not sure how it’s done officially, however. Applications should store their stuff inside !AppDir.Resources. with a folder for each language and a default of !AppDir.Resources.UK for a fallback. In theory, “all” that you need to do is to create a suitably-named new folder for each application, but that’s potentially a fair bit of work. Once you take interactive help into account, Messages files alone can quickly become huge. There could also be quite a lot of weird stuff in an application’s resources, and for some you might need oddball tools to remake them in another language – menus are bad, since everyone rolled their own because Acorn never provided an official equivalent to Templates. Oh, and many third-party developers would be delighted if someone volunteered to translate their software (and keep it fairly up to date, of course). I know I would… :-) |
Clive Semmens (2335) 3276 posts |
This whole thread has been bending my brain from the beginning, but I think something just snapped… Although it damn well shouldn’t, since I’m (probably) the only person in the world who knows (however slightly) either Laana or Maara; but then the novel in which these languages appear isn’t actually published yet, although a few other people have seen drafts. |
Steve Drain (222) 1620 posts |
If you do *Countries you will only get Switzerland, but there is an extended list of Country/Territory number allocations that has Swiss1, Swiss2, Swiss3 and Swiss4. Just at this instant I cannot remember where, but I have the copy I used when working on internationalisation. The inconsistency remains, though. Just to throw another spanner in the problem of translations, the Messages files in ResourcesFS that are part of the Rom image are compressed using the OS dictionary. As such they are largely unintelligible, so the source is necessary. I seem to remember that the OS dictionary is generated during compilation, so that may change from version to version. Is that correct? |
James Wheeler (3283) 344 posts |
That’s not a big deal as I was kind of expecting that. It does make my life easier that I don’t need to do that with some applications, though. |
Chris Evans (457) 1614 posts |
Whilst releasing may not help anyone else, documenting how you do what you do would! |
Pages: 1 2