jirentabu / crashrpt

Automatically exported from code.google.com/p/crashrpt
0 stars 0 forks source link

REQ: Ability to specify relative path to language.ini file #34

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
if the user does not have write access to the application folder, then the
current method of "copy in the correct language file" will fail.  there
needs to be a way to specify the path to the language file instead, and
have that be used

What steps will reproduce the problem?
1. lock the folder of the app, or put it on a read only server
2. launch
3. the "langage file copy" operation fails
4. look for a sanctioned method to specify lang file path
5. weep in dispair

What is the expected output?
--> an API for this

What do you see instead?
--> no API

What version of the product are you using?
v.1.2.3

On what operating system?
Windows 7 + latest updates

Please provide any additional information below.
--> could be specify the path in the param block, or a callback function. 
i prefer a callback function

if you do this for me, i will provide French, German, Japanese, Italian,
Spanish, Portuguese, possibly Chinese, Thai and Korean translations

Original issue reported on code.google.com by anbaricf...@gmail.com on 20 Apr 2010 at 11:25

GoogleCodeExporter commented 9 years ago
This is useful. 

Original comment by zexspect...@gmail.com on 21 Apr 2010 at 3:17

GoogleCodeExporter commented 9 years ago

Original comment by zexspect...@gmail.com on 21 Apr 2010 at 3:17

GoogleCodeExporter commented 9 years ago
JOY!  This also makes it compatible with CFLite-derived projects, which has a
separate directory automatically selected per language.  any ETA?  and thanks 
again.

Original comment by anbaricf...@gmail.com on 21 Apr 2010 at 3:54

GoogleCodeExporter commented 9 years ago
pseudocode for CFLite apps to get the language directory:

CFStringRef     CFBundleCopyLocalizationPath()
{
    CFileRef        fileRef(CFileRef::kFolder_BundleResourcesDirectory);
    SuperString     pathStr(fileRef.path());
    CCFArray        arrayRef(CFBundleCopyBundleLocalizations(CFBundleGetMainBundle()));
    CCFArray        prefRef(CFBundleCopyPreferredLocalizationsFromArray(arrayRef));
    SuperString     resLangStr(kCFURLPlatformPathSeparator);

    resLangStr.append((CFStringRef)prefRef[(CFIndex)0]);
    resLangStr.append(".lproj");
    pathStr.append(resLangStr);
    return pathStr.Retain();
}

now, presuming you've put the lang files into the appropriate directories, and
renamed them to "crashrpt_lang.ini", the caller pseudocode is like this:

    SuperString         langPath(CFBundleCopyLocalizationPath(), false);

    langPath.append(kCFURLPlatformPathSeparator);
    langPath.append("crashrpt_lang.ini");

    CFileRef            langFile(langPath);

Original comment by anbaricf...@gmail.com on 21 Apr 2010 at 6:44

GoogleCodeExporter commented 9 years ago
actually nevermind the callback, just make it one of the paramblock strings

Original comment by anbaricf...@gmail.com on 21 Apr 2010 at 8:19

GoogleCodeExporter commented 9 years ago
I implemented this enhancement. You can checkout the latest code from 2.5 branch
right now or wait until 1.2.4 release. I plan to release 1.2.4 in the second 
decade
of May.

Original comment by zexspect...@gmail.com on 22 Apr 2010 at 11:09

GoogleCodeExporter commented 9 years ago
Oops.. the correct name for the branch is 1.2, not 2.5. My mistake. The URL of 
the
branch is https://crashrpt.googlecode.com/svn/branches/1.2

Original comment by zexspect...@gmail.com on 22 Apr 2010 at 11:22

GoogleCodeExporter commented 9 years ago
yay it works!  note: i'd like to be able to specify the path to the file 
itself, not
just it's directory, that way i can use my own file naming convention.  also, 
will
this work with a relative file path (relative to CrashSender.exe or 
CrashRpt.dll) ?

Original comment by anbaricf...@gmail.com on 24 Apr 2010 at 6:20

GoogleCodeExporter commented 9 years ago
This enhancement is implemented in v.1.2.4.

Original comment by zexspect...@gmail.com on 7 May 2010 at 9:03