Skip to content

Language strings cleanup#1702

Merged
dregad merged 9 commits intomantisbt:masterfrom
dregad:i27298-lang-strings-cleanup
Oct 10, 2020
Merged

Language strings cleanup#1702
dregad merged 9 commits intomantisbt:masterfrom
dregad:i27298-lang-strings-cleanup

Conversation

@dregad
Copy link
Copy Markdown
Member

@dregad dregad commented Sep 19, 2020

There are several duplicated language strings defined for the same labels. We should use a single, common string for a given purpose.

Additionally, there are a few old, unused strings that need to be removed.

Fixes #27298

@dregad dregad force-pushed the i27298-lang-strings-cleanup branch from 674a4bb to c657e97 Compare September 20, 2020 14:44
@vboctor
Copy link
Copy Markdown
Member

vboctor commented Sep 21, 2020

I like the cleanup, but worry about some of these strings may be used by plugins. Thoughts? Should we have a deprecated strings section for ones that are likely to be used - e.g. print, update, etc?

@dregad dregad force-pushed the i27298-lang-strings-cleanup branch 2 times, most recently from 41d3924 to 3e7e477 Compare September 25, 2020 19:14
@dregad
Copy link
Copy Markdown
Member Author

dregad commented Sep 25, 2020

worry about some of these strings may be used by plugins. Thoughts? Should we have a deprecated strings section for ones that are likely to be used

@vboctor I can think of 3 possible approaches here

Nr Description Pros Cons
1 Remove the strings without any specific handling (i.e. what I've done in this PR) No extra work or overhead May cause breakage or unwanted behavior, depending on $g_display_errors settings - if 3rd-party plugins use a removed string, an error or warning message may be displayed, or nothing at all. Note: when PR #1696 is merged, the last case (no display) won't happen anymore, as the missing language string's key will be displayed instead of an empty string.
2 Leave the strings in the language files, but move them down to an Obsolete section and add a comment that they are deprecated and should not be used No overhead, simple change Strings remain in the system, possibly forever; plugins using them are not specifically informed of deprecation, and we can only hope but not enforce that new plugins actually don't use the obsolete strings
3 Define a list of obsolete language strings and have Lang API trigger a deprecated warning when they are referenced User-friendly solution Adds complexity and overhead to the code : global variable to store obsolete strings, extra lookup in lang_get calls and trigger a deprecated warning which may be squelched anyway

I don't think option 2 is a good approach at all, and once #1696 gets merged, option 3 will only add marginal value (displaying the actual deprecated localization instead of the language string key + a warning). IMO it is not worth the effort to implement 3, and I recommend to stick with option 1.

@dregad dregad force-pushed the i27298-lang-strings-cleanup branch from 3e7e477 to 3e66dbf Compare September 25, 2020 23:46
@dregad
Copy link
Copy Markdown
Member Author

dregad commented Sep 25, 2020

FTR I just merged #1696 after fixing the last review comment, so I rebased this branch on top of it.

There were several language strings defined for the same label:
edit_link, bugnote_edit_link, update_bug_button.

Adding a new generic short string and replace all occurences of the old
ones in the code.
There were several language strings defined for the same label:
actiongroup_menu_delete, delete_attachment_button, delete_bug_button,
delete_filter_button, delete_link, delete_relationship_button.

Adding a new generic short string and replace all occurences of the old
ones in the code.
Using the generic update language string and removing duplicate
plugin_update.
There were several language strings defined for the same label:
actiongroup_menu_move, move_bug_button.

Adding a new generic short string and replace all occurences of the old
ones in the code.
There were several language strings defined for the same label:
actiongroup_menu_close, close_bug_button.

Adding a new generic short string and replace all occurences of the old
ones in the code.
There were several language strings defined for the same label:
add_user_to_monitor, add_new_relationship_button.

Adding a new generic short string and replace all occurences of the old
ones in the code.
There were several language strings defined for the same label:
click_to_login, login_button, login_link.

Adding a new generic short string and replace all occurences of the old
ones in the code.
- switch and related constants (on, off)
- vote_added_msg
@dregad dregad force-pushed the i27298-lang-strings-cleanup branch from 3e66dbf to 4565713 Compare October 10, 2020 10:03
@dregad
Copy link
Copy Markdown
Member Author

dregad commented Oct 10, 2020

Without further feedback on this, I assume you agree with my proposed approach and will proceed with merging this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants