-
Notifications
You must be signed in to change notification settings - Fork 974
Showing better names for channels in about:brave page #10387
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10387 +/- ##
==========================================
+ Coverage 54.31% 54.33% +0.02%
==========================================
Files 245 245
Lines 21148 21156 +8
Branches 3259 3260 +1
==========================================
+ Hits 11486 11495 +9
+ Misses 9662 9661 -1
|
@luixxiul how to resolve the failing check in my commit ? |
@prasanthp96 the Travis build has always failed and you don't have to worry about that. If you find your change breaks existing tests, please fix it. If you are not sure, please just leave it. |
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.
Great start 😄
Since these strings will be human readable, we're going to want to localize them.
- You can put the string in
app/extensions/brave/locales/en-US/app.properties
. It could look like:
channelDev=Release
channelBeta=Beta
Anything in the en-US .properties file will be automatically submitted to our translators 😄 This will let folks translate "Release" to their native language
- This file can be updated to include l10n.js and then use the
translate
method. You can see an example inapp/extensions.js
So it would end up being like:
let channelMapping = {
'dev': l10n.translate('channelDev')
@@ -784,8 +784,9 @@ module.exports.loadAppState = () => { | |||
|
|||
immutableData = module.exports.runPostMigrations(immutableData) | |||
} | |||
immutableData = setVersionInformation(immutableData) |
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 had to be moved; translations are only available AFTER the locale
finishes initializing 😄
@@ -20,6 +20,16 @@ exports.channel = () => { | |||
return channel | |||
} | |||
|
|||
exports.formattedChannel = () => { |
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.
Existing method was left alone since telemetry also uses it (and the values in that case shouldn't change)
'autoplayMedia' | ||
'autoplayMedia', | ||
// Release channels | ||
'channelDev', |
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.
New translatable strings must be entered here in order to be accessible by the locale.translate()
method. The name here matches the name in en-US/app.properties
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.
@prasanthp96 I added a commit which I'd like you to check out 😄 The strings are now translatable. Let me know what you think!
- make a new method (so old code paths aren't affected) - add in call to locale.translate - add names for `dev` and `beta` to en-US file The strings `Release` and `Beta` will now be translateable into other languages :) Auditors: @prasanthp96
Showing better names for channels in about:brave page
Showing better names for channels in about:brave page
I have modified the function that returns the channel name. I have included a map which has the mapping of the channel names as asked in the issue
Fix #10239
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
See #10239
Reviewer Checklist:
Tests