ResFinder
Chris Johnson (125) 825 posts |
This is the crux. In a lot of my software I use the toolbox, in the rest it is template files. Although in the template based apps, the !Run file ‘hardcodes’ the resources path to UK, it is simple for anyone to add their own non-english language files and change the path. Using ResFind instead to locate resources is also a trivial change. With the toolbox/res files other languages can be added easily. However, no-one has ever offered to do the translation (I am not up to the task), no-one has ever asked whether such files are, or might be, available, etc., etc.. At the end of the day, the lack of non-english language resources, will be largely down to the lack of capability, and hence interest, of most of the software authors. |
Steve Drain (222) 1620 posts |
@Rick
They may be, but there are quite a few Toolbox apps, including those !Configure ones, that can only be made international using the suffix method as they stand. I agree that the directory method is probably a better standard to go for, but that would require some modification of those apps.
No. No. Do you want to internationalise Sprites?
Yes. It shows just how messy this international thing is. As remarked, Acorn did not tackle this, and set a poor example.
I think you have missed the point I was making. Using ResFinder you have to accept the path variable it sets up. You cannot omit or add to it. Creating the path variable in the !Run file allows the author full control, uses the facility the OS already offers, and is much more transparent than a machine code utility. You still end up with the same way of finding resource files, just as you have described.
I do not thing you understand how files get into ResourceFS. ;-) @Me
So I wrote it so. Another 10 minutes and 124 bytes. So now you could write the Set MyApp$Path above without even Running SetCountry first. The remaining problem is where you create the variable – it should be in PreDesk, probably, but then you loose the application independence. |
Steve Drain (222) 1620 posts |
I have just worked this out. = I have just realised that there is an aspect I have not tested so hold on = No, a false trail – sorry. ;-( |
Steffen Huber (91) 1953 posts |
Yes, of course. One simple example: in a word processor, for “bold” and “italic”, english programs use mostly a “b” and “i” in toolbar icons, while german versions use “F” and “K”. |
Rick Murray (539) 13851 posts |
Yes… and a general apathy because those who don’t want everything in English aren’t making enough noise, so we’ll all think “everything in English” will suffice. Like pretty much ALL of the standard applications… Hmmm…
I’m aiming for, and supporting, the directory method given that the Toolbox is the anomaly, plus it would not seem to cater for sprites.
<shakes head in disbelief> Oh, Acorn, you can’t half-do a thing like internationalising….. As Steffen says, “B” and “I” are English for bold and italic. It is “F” and “K” in German (thanks Steffen), and I think "G"ros and "O"blique in French. So, the directory method it is, then.
You can control (the name of) the path variable it sets up, plus have only the most appropriate resources directory (custom not ending $Path), or a full path to all resources (custom ending $Path, or accepting app$Path default). Lame example (not using ResFinder):
Something along those lines, to extend one path with another…
What, you mean like:
? If this worked, you do realise that on a UK system you would be setting “UK” twice? As it happens, I tested the idea with “%0$Path” changed to “Test$Path” and “<Obey$Dir>” changed to ‘$’ and ran the above, as an Obey file.
That’s not what you meant, right? Update: As I was writing this, you changed the above code to “No, a false trail – sorry. ;-(”. No need to apologise. It’s worth trying alternatives, so it is clearer what does and does not work.
No, I don’t, really. (^_^) |
WPB (1391) 352 posts |
I’d like to cross-link to Transitioning to Unicode alphabet, because this is a related issue. I think it would be a good idea, rather than doubling up every existing territory with a “UTF8 mirror” of itself, if there were some UTF8-master configuration option that made the existing APIs prefer to load a file called “Res+” or “Templates+” or “Messages+” if it existed. That’s just AFTER the above resolution for language has happened. Then people can start including UTF8 encoded resource files, too, for each language supported, and we may slowly overcome the resistance to shift to UTF8 in the Wimp. (Maybe the “+” suffix could be worked as a system variable, too…) |
Steve Drain (222) 1620 posts |
It is obvious once you point it out. ;-) I have dealt with interchangeable Sprites files with the Toolbox, but never ones that were based on the country. In which case, I think even Toolbox apps should follow the directory method, putting Res and Messages files in there as well, ignoring the country suffix. My late attempt at cleverness appeared to work, but I had left some bits trailing from earlier experiments and I rushed to publish before being engaged for the evening. It does not work because Set does GSTrans on the second parameter, and the redirection contains a ‘<’ which is special to GSTrans. That is a pity, because I was going to use PipeFS to do the transfer rather than the ScrapFile. ;-) I still think that a file to set the Country as a system variable, or as a code variable, and then leaving authors to set up the path variable in the !Run file in any way that suits is simpler than any of the versions of ResFind[er].
Yes I did. Either it is too trivial to matter, or:
|
Chris Johnson (125) 825 posts |
Yes. I am just in the final stages of rewriting one of my apps, which is oslib/toolbox based, and was checking for ease of internationalisation. In addition to the res and messages files there are also in-app help files etc. Thus there still needs to be a resources.country directory for the versions of these help files. |
Rick Murray (539) 13851 posts |
Can I make a suggestion for UTF8 to be determined by a “u” prefix? Like “uFrance” and “uUK”? |
WPB (1391) 352 posts |
Sounds perfectly fine to me. I guess it depends if you want all the Unicode resources clumped together in the Filer display, or each country/language’s resources! Of course, ResFinder and ResFind could implement something like this already without any trouble, by, say, looking at a system variable UTF8$Override or the like and taking the appropriate action. But if the Toolbox behaviour was going to be changed, or the Wimp’s behaviour for loading Templates, and MessageTrans’s for loading Messages, it would be nice to be forward-thinking and implement something like this, too. |
Steve Drain (222) 1620 posts |
Not to be defeated by the command line, you might try this: In the !Run file:
The ResFinder Obey file in the same directory:
;-) |
Rick Murray (539) 13851 posts |
There is no other option that is backwardly ‘safe’. Consider: !App.Resources.Netherlands !App.Resources.Netherlands+ On a RISC OS 3.x machine, that would unpack as “!App.Resources.Netherland”, and you may well be unpacking the UTF8 versions over top of the Latin ones. |
Rick Murray (539) 13851 posts |
The fourth “real” release of ResFinder (v0.05) is now available. http://www.heyrick.co.uk/software/resfinder/ (39K) Okay.
Alright Steve, over to you… (^_^) |
Steve Drain (222) 1620 posts |
I am a bit in the dark about how UTF8 resources would be used, but would it not be simpler to place them in a subdirectory of the existing language directory, eg: ‘…France.UTF8’? You could still arrange the paths according to any global variable, but all of one language’s resources would be together and you would retain backward compatability. This would also mean that you did not have to duplicate resources that were not UTF8 dependendent, such as Sprites(!). |
Rick Murray (539) 13851 posts |
It would be more logical to have UTF8 resources with the Latin ones; but this assumes that the application will detect and act upon this. For simpler applications, it should suffice just to provide updated templates and messages; the app itself doesn’t necessarily need to know any different, just like it doesn’t need to know if it is talking in French or… |
Rick Murray (539) 13851 posts |
Sorry for the terse reply – my phone’s edit handling is pretty naff and this isn’t helped by the small reply box… |
Steve Drain (222) 1620 posts |
I do not think my command line code for setting variables is reliable, but then it was always a toy. I will use system code variables for Country and Alphabet when I get around to changing my apps to use the agreed method. However, I do think that an Obey file is fine for setting the path variable. Things have got a bit too extended to post, so I have bundled something up at http://www.kappa.me.uk/Miscellaneous/International.zipI have a couple more related things to raise. Sometimes I have used *Prefix, provided by the DDEUtils module, to set an application-wide path prefix. This is very convenient, but it is not a path variable and AFAICT it is incompatible with the international schemes discussed here. On the other hand, it might be modified to provide something very like ResFinder. Is anyone interested? While playing around with this I re-discovered that in RO 6 OS_EvaluateExpression, used for command lline evaluations, has very useful extensions, such as LEAFNAME. Is there a prospect of RO 5 getting these anytime soon? |
Rick Murray (539) 13851 posts |
;-) Sometimes toys are the funnest1 things to play with. FWIW, I’m having a “play” with RO5 and !Edit with Corpus font. Latin1 – “Voilà! C’est pas le même idée!” From UTF8 – “Voilà! C’est pas le même idée!” The only things that pass are plain ASCII (>31 & <127). Depending upon application, a UTF-8 version might be needed for UK language as well, to permit sexed quotes, copyright, £ and €…
I’ve highlighted the important bit. It is provided by a part of a commercial product, so while it is useful, it is something of a non-starter. ResFinder is(will be) EUPL. If it gets in any way popular and ROOL want a copy, then Castle licence is fine by me.
Mmm, leafname. Could be good. [re: http://www.riscos.com/support/developers/riscos6/core/evaluateexpression.html] 1 People who wish to correct my grammar are so missing the point! 2 I believe you can write German without accents and stuff (“ü” → “ue”, “ß” → “ss”/“sz”(archaic?), etc). I also believe that arbitrarily messing with somebody else’s language tends to annoy the natives… probably best to do it properly, eh? |
Rick Murray (539) 13851 posts |
Not bad. But I can do all that in one itty-bitty self-contained program. :-P I notice you are looking for “<country>.UTF8”. That might be a better option than “u<country>”. What do others think? |
Rick Murray (539) 13851 posts |
Talking of countries and international things… Is this a bug, or is it supposed to say something? Perhaps you meant to say this: 頑張ってください!私は、あなたが英語を話すことを望んでいる :-P |
Steve Drain (222) 1620 posts |
DDEUtils was cetainly commercial to start with, but I am fairly sure that it has been supplied in !System for a very long time. It is certainly in both the ROL and ROOL versions. However, it does have to be RMLoaded.
My suggestion to just write an Obey file has no question of licences involved at all. ;-) My proglet to Set the system code variables might have to have some sort of licence, but that would be the Modified BSD, which is about as free as it gets.
ResFinder is 2k and is an Absolute. I’m old-school and in my book that is not itty-bitty. Note that my Obey version is only 575 bytes. ;-)
I suggested that earlier today. |
WPB (1391) 352 posts |
Yes, I think it’s definitely neater. Nice work! |
Rick Murray (539) 13851 posts |
Plus the code part. ;-) Sadly, I’ve been in the Windows arena for so long that anything that is small enough that you don’t count the commas and perform rough mental division is… itty-bitty. I’m quite pleased that the linker didn’t bloat it too much. Not sure what the point of the little chunk of code at the start is, but it’s not too big to worry about.
Okay then. I believe ResFinder v0.06 will ‘become’ soon. ;-) |
Steve Pampling (1551) 8172 posts |
Interesting: Just happened to notice as both machines popped up page update notifications while I was testing access to the OWA and Citrix Secure Gateway on the newer link |
Steve Pampling (1551) 8172 posts |
Yes. Someone pointed this out to me some months ago – with the small caveat you mention:
Which, since I noticed the situation, I do as a routine boot item since some utilities seem to require it. |