fritte02 / lightopenid

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

Localization #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Could you please add support for localization? 

You could add "/* l18n */" after each string that should get localized, so it 
would be easier to find them. If you created a wiki-page, I'd add my l18n for 
german.

Original issue reported on code.google.com by themoose...@googlemail.com on 7 Apr 2011 at 9:11

GoogleCodeExporter commented 9 years ago
The exceptions thrown by LightOpenID are intended for programmers using the 
library. You should catch them and then report them to the user.

While documenting them may be a good idea, I see no point in adding i18n 
support.
By the way, you probably mean internationalization (i18n), not localization 
(l10n).

Original comment by mewp...@gmail.com on 9 Apr 2011 at 12:07

GoogleCodeExporter commented 9 years ago
Also, I've just noticed that LightOpenID forwards curl errors as exceptions if 
there are any, so it's not even possible to provide i18n for them.

Original comment by mewp...@gmail.com on 9 Apr 2011 at 12:16

GoogleCodeExporter commented 9 years ago
Oh, I thought the exceptions were for the user. I should probably read 
http://www.php.net/manual/en/language.exceptions.php and 
http://www.php.net/manual/en/class.exception.php

At the moment, I use this code-structure:
try {
    [OpenID-related code, just like in the example]
} catch(ErrorException $e) {
    echo $e->getMessage();
}

As my users are more likely to be able to understand German than English, 
should I use a structure like this:
try {
    [OpenID-related code, just like in the example]
} catch(ErrorException $e) {
    switch($e->getCode()){
        catch 0:
            echo "My error-message in german.";
            break;
        catch 1:
            echo "Another translated error message.";
            break;
        default:
            echo $e->getMessage();
    }
}

> By the way, you probably mean internationalization (i18n), not localization 
(l10n).
Oh, thanks for the hint. Yes, I ment i18n.

This enhancement can be closed.

By the way, how can I submit Enhancements? I can't see any way to set the 
Priority or the Type of a bug.

Original comment by themoose...@googlemail.com on 11 Apr 2011 at 6:38

GoogleCodeExporter commented 9 years ago
Apparently, people who are not project members can't submit issues with labels, 
and I can't change it anywhere (according to 
http://code.google.com/p/support/wiki/Permissions). That's not a big problem 
though, since I label the issue correctly when I answer anyway.

Original comment by mewp...@gmail.com on 11 Apr 2011 at 10:01