On May 6, 1:25 pm, VK <schools_r...@[EMAIL PROTECTED]
> wrote:
> /* It would be nice to have button labels on
> * user's preferred language and not English
> * only.
> * navigator.userLanguage (IE) and
> * navigator.language (some other UAs) values
> * may have different meanings: OS language,
> * or browser interface language, or the preferred
> * language in the browser settings. Either way
> * IMHO it still allows to make a good guess what
> * language the current user would like to see.
> * If the detected language is not implemented yet
> * then English is used by default.
> * For such basic lexicon as "Yes", "No", "Cancel" etc.
> * we may disregard country-specific variations, so we
> * are taking only two first letters from the language
> * code - so say "en", "en_US", "en_GB" will be "en".
> *
> *? Objections?
> */
>
> if ('userLanguage' in navigator) {
> var lang = navigator.userLanguage.substring(0,2);
> }
> else if ('language' in navigator) {
> var lang = navigator.language.substring(0,2);
> }
> else {
> var lang = 'en';
> }
>
> TransModal.lang = (lang in TransModal.buttonLabelSet) ?
> lang : 'en';
I tried to find a resource with standard button labels in localized
Windows versions but no success. Anyone has one?
It also could be easily checked with IE installed via VBScript. Anyone
has time to match English labels to localized ones using provided
VBScript?
I am interested in any language of course, especially in French,
German and Spanish.
--------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en-US">
<head>
<meta http-equiv="Content-type"
content="text/html; charset=iso-8859-1">
<title>Label test</title>
<script type="text/vbscript">
</script>
</head>
<body>
<p>VBScript MsgBox labels' test</p>
<p>
<button type="button"
onclick='MsgBox "OK only", 0'
>OK only</button>
<button type="button"
onclick='MsgBox "OK | Cancel", 1'
>OK | Cancel</button>
<button type="button"
onclick='MsgBox "Abort | Retry | Ignore", 2'
>Abort | Retry | Ignore</button>
<button type="button"
onclick='MsgBox "Yes | No | Cancel", 3'
>Yes | No | Cancel</button>
</p>
</body>
</html>


|