how can I get the currently used catalog of my script (name and path)?
The functions getcountryinfo, getlanguageinfo, getlocaleinfo, getsystemcountry and getsystemlanguage do not seems to return the info as I would need.
get currently in use catalog
Re: get currently in use catalog
You cant know what catalog is used. Except you personal track of what catalog you have open via OpenCatalog()
As for the rest command , what info wyou expected to get?
As for the rest command , what info wyou expected to get?
Christos
Re: get currently in use catalog
I know how to use opencatalog, the problem is that I want to store some other small files theat need translation as well in the directory of the catalog, then at least i would need to know the path of the curret opened catalog if any has been detected or otherwise I can use the default files.
Opencatalog does not return the result of the action taken.
I could assume the path as
t = GetLanguageInfo(GetSystemLanguage())
then
"<current-directory>/Catalogs/"..t.Name it shoul return, for example, <current-directory>/Catalogs/german/MyProgram.catalog but if the catalog has been saved as deutsch rather then german? how can I detect it?
Opencatalog does not return the result of the action taken.
I could assume the path as
t = GetLanguageInfo(GetSystemLanguage())
then
"<current-directory>/Catalogs/"..t.Name it shoul return, for example, <current-directory>/Catalogs/german/MyProgram.catalog but if the catalog has been saved as deutsch rather then german? how can I detect it?
Re: get currently in use catalog
i think you are trying to get locale name aka greek.catalog
the above code should provide locale default name, path is as explained in manual of OpenCatalog()
so OpenCatalog("MyProgram.catalog") in me, will open
this offcourse is vulnerable to human mistakes but.. its an idea!
check also SpawnPPC who did a similiral thing https://forums.hollywood-mal.com/viewto ... 990#p20990
p.s.
your last question about deutch/german ,
practically all shall use international eka german, (the one system returns)
also there is NO savecatalog so, someone manualy shall save it.
so there is no bulletproof way to check what catalog has opened (request in wihlist)
a possible workaround would be to check using Exists() if the international directory name exist, then make a change, and reload to see if it there, otherwise delete newlly created file, i know its complicated but
as final note you may use , OpenFile() and not OpenCatalog() , you have more control, and catalog is not that compilcated to interpret yourself
Code: Select all
LocaleName =GetLanguageInfo(GetSystemLanguage()).Name
DebugPrint(LocaleName)
so OpenCatalog("MyProgram.catalog") in me, will open
an idea is to have as first String in your file locale so<current-directory>/Catalogs/greek/MyProgram.catalog
therefore by checking first catalog string, you get languange and also can check if is correctly loaded, since string will be empty otherwise.; First line declare your languan
greek
;
blah blah line 2
;
blah blah blah line 3
this offcourse is vulnerable to human mistakes but.. its an idea!
check also SpawnPPC who did a similiral thing https://forums.hollywood-mal.com/viewto ... 990#p20990
p.s.
your last question about deutch/german ,
practically all shall use international eka german, (the one system returns)
also there is NO savecatalog so, someone manualy shall save it.
so there is no bulletproof way to check what catalog has opened (request in wihlist)
a possible workaround would be to check using Exists() if the international directory name exist, then make a change, and reload to see if it there, otherwise delete newlly created file, i know its complicated but
as final note you may use , OpenFile() and not OpenCatalog() , you have more control, and catalog is not that compilcated to interpret yourself
Christos
Re: get currently in use catalog
...so there is no bulletproof way to check what catalog has opened (request in wihlist)
That exactely the point i'm arguing.
Having hundreads languages supported with the possible double name it is difficult to handle an exists function for each of them.
An Andrea's fix would be appreciated
That exactely the point i'm arguing.
Having hundreads languages supported with the possible double name it is difficult to handle an exists function for each of them.
An Andrea's fix would be appreciated
- airsoftsoftwair
- Posts: 5575
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: get currently in use catalog
I agree that it could be useful to find out the language of the currently used catalog. I'll see what I can do.