-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Localized blackberry.app.name and blackberry.app.description #277
Conversation
@jeffheifetz Code review please. |
Going to update the automatic tests as well, so this doesn't happen again. But putting pull request up now so it can begin being reviewed etc. |
Looks good James, r+ with the automated changes |
@jeffheifetz Updated blackberry.app functional tests to include localization tests for name&description |
kills our non-localized test. :( Can this be included in as a separate app? hate that we are not testing the most common case of blackberry.app |
@nukulb Why does it "kill our non-localized test"? The existing name&description elements that contain the non-localized values are still there. I'm simply including additional localized values as well. |
@jkeshavarzi you are correct, I didn't read your tests properly, its a good test but I don't know why it works. |
@tracyli - can you give this a quick test, we need respin the SCM bundle with this fix |
tested in 10.0.9.1103: blackberry.app works as before;blackberry.app.name and blackberry.app.description change with localized values; app test suite got passed in functional test app. There's an observation: |
@tracyli I think you mean " I need to change xml:lang="fr" to be xml:lang="fr-FR" to make it work, is it what expected?". Working on it. |
Fixed two issues;
Please use blackberry-webworks/BB10-Webworks-Packager#111 when testing. @jeffheifetz Can you please take a look at the new changes? |
Please add unit tests to cover the locale generaliztion (fr when fr-CA is not available) |
r+ |
return data[locale]; | ||
} else if (data[locale.split("-")[0]]) { | ||
//Region specific locale [i.e. fr-CA] | ||
return data[locale.split("-")[0]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this comment misleading, isn't this the "region unspefic" locale?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this returns fr for fr-CA?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup
From: Eric Pearson [mailto:notifications@github.com]
Sent: Tuesday, November 20, 2012 07:21 PM
To: blackberry-webworks/BB10-WebWorks-Framework BB10-WebWorks-Framework@noreply.github.com
Cc: James Keshavarzi
Subject: Re: [BB10-WebWorks-Framework] Localized blackberry.app.name and blackberry.app.description (#277)
In ext/app/client.js:
value = readOnlyValues ? readOnlyValues[field] : null; Object.defineProperty(_self, field, {"value": value, "writable": false});
}
+function getLocalizedText(data) {
- var locale = navigator.language.toLowerCase();
- if (data[locale]) {
return data[locale];
- } else if (data[locale.split("-")[0]]) {
//Region specific locale [i.e. fr-CA]
return data[locale.split("-")[0]];
this returns fr for fr-CA?
—
Reply to this email directly or view it on GitHubhttps://github.com//pull/277/files#r2189016.
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I shall fix it.
From: Jeffrey Heifetz [mailto:notifications@github.com]
Sent: Tuesday, November 20, 2012 07:07 PM
To: blackberry-webworks/BB10-WebWorks-Framework BB10-WebWorks-Framework@noreply.github.com
Cc: James Keshavarzi
Subject: Re: [BB10-WebWorks-Framework] Localized blackberry.app.name and blackberry.app.description (#277)
In ext/app/client.js:
value = readOnlyValues ? readOnlyValues[field] : null; Object.defineProperty(_self, field, {"value": value, "writable": false});
}
+function getLocalizedText(data) {
- var locale = navigator.language.toLowerCase();
- if (data[locale]) {
return data[locale];
- } else if (data[locale.split("-")[0]]) {
//Region specific locale [i.e. fr-CA]
return data[locale.split("-")[0]];
Isn't this comment misleading, isn't this the "region unspefic" locale?
—
Reply to this email directly or view it on GitHubhttps://github.com//pull/277/files#r2188880.
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this is ok? If this is portuguese and you return pt for pt-BR a lot of people are going to be confused as the language is pretty different. Same goes for mandarin and cantonese with zh-CN and zh-HK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind disregard my comments, it's probably good enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be interesting to see what the os does in these situations. I know, tracy and I were seeing it default to the language locale (fr) when the region wasn't available.
From: Eric Pearson [mailto:notifications@github.com]
Sent: Tuesday, November 20, 2012 07:27 PM
To: blackberry-webworks/BB10-WebWorks-Framework BB10-WebWorks-Framework@noreply.github.com
Cc: James Keshavarzi
Subject: Re: [BB10-WebWorks-Framework] Localized blackberry.app.name and blackberry.app.description (#277)
In ext/app/client.js:
value = readOnlyValues ? readOnlyValues[field] : null; Object.defineProperty(_self, field, {"value": value, "writable": false});
}
+function getLocalizedText(data) {
- var locale = navigator.language.toLowerCase();
- if (data[locale]) {
return data[locale];
- } else if (data[locale.split("-")[0]]) {
//Region specific locale [i.e. fr-CA]
return data[locale.split("-")[0]];
Are you sure this is ok? If this is portuguese and you return pt for pt-BR a lot of people are going to be confused as the language is pretty different. Same goes for mandarin and cantonese with zh-CN and zh-HK.
—
Reply to this email directly or view it on GitHubhttps://github.com//pull/277/files#r2189066.
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.
tested in 10.0.9.1103 with packager build http://ci0000003863287:8080/hudson/job/BB10-Webworks-Packager-next-fix-case-sensitive/3/ and framework build http://ci0000003863287:8080/hudson/job/BB10-Webworks-Framework-next-issue378/4/: blackberry.app works as before;blackberry.app.name and blackberry.app.description change with localized values; app test suite got passed in functional test app |
@jkeshavarzi can I get a squash so we can commit this? |
Fixes blackberry#378 Reviewed By: Jeffrey Heifetz <jheifetz@rim.com> Tested By: Tracy Li <tli@rim.com>
-Comment fixed |
Fixes blackberry#378
Testing scenarios;
-Test blackberry.app API's and ensure nothing is broken.
-Test blackberry.app.name and blackberry.app.description returns localized values when language is changed on the device
-Confirm tests are passing in functional test app