Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Sort properties file and remove duplicates #10647

Merged
merged 2 commits into from
Sep 4, 2017
Merged

Sort properties file and remove duplicates #10647

merged 2 commits into from
Sep 4, 2017

Conversation

srirambv
Copy link
Collaborator

Submitter Checklist:
Remove duplicate strings in properties file
Sort string alphabetically in all properties file
Merged error.properties into errorMessage.properties

Fixes : #3958

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.

Test Plan:
Verify all text in browser is shown as before

Reviewer Checklist:

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@luixxiul
Copy link
Contributor

I'm wondering if the strings should also be sorted semantically, separating lines with comment lines.

@srirambv
Copy link
Collaborator Author

@luixxiul Could you provide more details ?

customFilters=Custom filters
disableAdBlockForSite=Disable Ad block
lastCheckETagLabel=Last check ETag:
lastUpdateCheckDateLabel=Last update check:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srirambv I mean like this:

label_lastUpdateCheckDate=...
label_lastCheckETag=...

Specifying a hierarchy with dashes or something more proper would make it easier for us to see the system of the localization strings and enhance it when new ones get added.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luixxiul I'd suggest creating a new issue and proposing the strategy. If it's something that is easier for translators and also for programmers, then maybe we can adapt it. Personally, I don't know how helpful it would be

autofillData=Autofill data
autofillTitle=Autofill Settings
city=City
country=Country
Copy link
Contributor

@luixxiul luixxiul Aug 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srirambv another example:

addresses_city=...
addresses_country=...

...

creditCards_edit=...
creditCards_expirationDate=...

The hierarchy has not been explicitly specified with a certain rule which we should follow when adding/editing the localization strings. Creating that rule would increase maintainability.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luixxiul definitely something we'd want proposed in its own issue

@@ -1,9 +0,0 @@
errorReload=Retry the URL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was removing this file intended? It's still referenced in a few places:

path.join(__dirname, 'extensions', 'brave', 'locales', lang, 'error.properties'),

<link rel="localization" href="locales/{locale}/error.properties">

<link rel="localization" href="locales/{locale}/error.properties">

<link rel="localization" href="locales/{locale}/error.properties">

(possibly others)

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments left 😄 The issue mentioned is that error.properties is referenced a few places which will break if the file is deleted. We should remove those references also

Do you have a list of the duplicate strings? (just curious how many there are / where they were)

@srirambv
Copy link
Collaborator Author

@bsclifton removed the references for error.properties

Do you have a list of the duplicate strings? (just curious how many there are / where they were)

There weren't much may be about 10. Most were in autofill and bookmark

@codecov-io
Copy link

Codecov Report

Merging #10647 into master will increase coverage by 0.39%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #10647      +/-   ##
==========================================
+ Coverage   54.16%   54.55%   +0.39%     
==========================================
  Files         247      244       -3     
  Lines       21543    21128     -415     
  Branches     3334     3262      -72     
==========================================
- Hits        11669    11527     -142     
+ Misses       9874     9601     -273
Flag Coverage Δ
#unittest 54.55% <ø> (+0.39%) ⬆️
Impacted Files Coverage Δ
app/browser/windows.js 17.82% <0%> (-6.49%) ⬇️
app/renderer/lib/extensionsUtil.js 55.84% <0%> (-3.93%) ⬇️
app/renderer/components/preferences/pluginsTab.js 45.83% <0%> (-3.19%) ⬇️
app/common/state/tabState.js 77.02% <0%> (-2.29%) ⬇️
app/browser/tabs.js 26.64% <0%> (-2.24%) ⬇️
js/settings.js 96.92% <0%> (-1.54%) ⬇️
js/actions/webviewActions.js 9.25% <0%> (-1.38%) ⬇️
js/stores/appStore.js 12.45% <0%> (-1.06%) ⬇️
app/renderer/reducers/frameReducer.js 26.31% <0%> (-0.76%) ⬇️
app/filtering.js 18.07% <0%> (-0.51%) ⬇️
... and 19 more

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 😄

@bsclifton bsclifton added this to the 0.21.x (Nightly Channel) milestone Sep 4, 2017
@bsclifton bsclifton merged commit 8993297 into brave:master Sep 4, 2017
@luixxiul
Copy link
Contributor

luixxiul commented Sep 5, 2017

Also maybe related;

screenshot 2017-09-05 13 19 20

See deleteBookmark.

@srirambv
Copy link
Collaborator Author

srirambv commented Sep 5, 2017

This is what I see on master with this merged

image

@bsclifton
Copy link
Member

there are definitely issues with this- I'm going to have to revert

@bsclifton bsclifton removed this from the 0.21.x (Nightly Channel) milestone Sep 5, 2017
@bsclifton
Copy link
Member

reverted with ab60908

@srirambv since there is a large impact to the app, maybe if we tried this again we should only sort (and not remove dupes / consolidate files)

@srirambv
Copy link
Collaborator Author

srirambv commented Sep 5, 2017

Sure will only do a sort

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants