#48776 closed defect (bug) (fixed)
Empty "Continue" Buttons in install process
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.4 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Upgrade/Install | Keywords: | has-patch |
Focuses: | javascript | Cc: |
Description
When installing WordPress the first step is to select a Language. When selecting a language the "Continue" button instantly changes its text to the translation of "Continue" in the selected language.
For some languages which do not have a translation of "Continue" no fallback is used. Instead the Button is Empty.
This happens for following Languages (Language Codes)
- as
- dzo
- rhg
- tah
Some other Languages like "azb" are using the english version als fallback.
All available Languages are loaded from this api Endpoint:
http://api.wordpress.org/translations/core/1.0/
The data from the api contains following information
{ "language": "dzo", "version": "4.7.2", "updated": "2016-06-29 08:59:03", "english_name": "Dzongkha", "native_name": "རྫོང་ཁ", "package": "http://downloads.wordpress.org/translation/core/4.7.2/dzo.zip", "iso": { "1": "dz", "2": "dzo" }, "strings": { "continue": "" } },
The continue field which is used for the continue button is empty.
Attachments (2)
Change History (13)
#1
@
5 years ago
- Focuses javascript added
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
- Version changed from 5.3 to 4.0
@
5 years ago
The patch addresses the problem in the server side and refactors the existing code to remove duplicates.
#2
@
5 years ago
I have now temporarily patched this problem "from the other side" by "translating" the missing strings to "Continue" for the four locales mentioned above.
A stable solution of this problem could perhaps more nicely be made by fixing the output of the api (which would be a fix in meta). The good thing about that approach is that one fix would automatically correct the problem also for recent versions of WordPress core.
#3
@
5 years ago
I have opened a corresponding Meta ticket: https://meta.trac.wordpress.org/ticket/4872
If that one is accepted by the Meta team, then this ticket could be closed as "Reported upstream".
#4
@
5 years ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Future Release to 5.4
- Owner set to SergeyBiryukov
- Status changed from new to reviewing
I think fixing this on both core and API side wouldn't hurt :)
#5
@
5 years ago
The reply on the meta ticket doesn't seem to share the idea this issue should be fixed also on the API side. I'd tend to agree a general fallback mechanism should be in place. Not sure it necessarily needs to be done in the API (as it sounds like it would be outside of the scope of an API from a "purist" perspective).
However, instead of just closing the meta ticket I'd tend to think this issue should be considered a bit more in depth in a broader discussion.
#7
@
5 years ago
@ocean90 Could you please let me know why patch was not applied as it is? It contains the code refactoring as well. Do you want me to create it as a separate ticket?
#8
follow-up:
↓ 10
@
5 years ago
There's currently no need for code refactoring here. The function is only used during the initial installation and not intended to be used for other use cases. To keep the change as small as possible I went with the simplified version of your fallback approach in PHP instead of JavaScript.
#9
@
5 years ago
@ocean90 Do you recommend to create a new ticket for refactoring to improve the quality of code? I understand that it's used only once during installation but it would be better to improve the quality.
#10
in reply to:
↑ 8
;
follow-up:
↓ 11
@
5 years ago
Replying to ocean90:
To keep the change as small as possible I went with the simplified version of your fallback approach in PHP instead of JavaScript.
Per the latest PHP Coding Standards Changes, the short ternary operator must not be used.
Should we rewrite [46784] to replace the operator or reconsider the standards?
#11
in reply to:
↑ 10
@
5 years ago
Replying to SergeyBiryukov:
Per the latest PHP Coding Standards Changes, the short ternary operator must not be used.
Should we rewrite [46784] to replace the operator or reconsider the standards?
In
language-chooser.js
, the line which overrides the value attribute could be changed tovalue: option.data( 'continue' ) || 'Continue',