#7076 closed defect (bug) (fixed)
I18n: make XProfile admin js text nodes translatable
Reported by: | Offereins | Owned by: | slaFFik |
---|---|---|---|
Milestone: | 8.0.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | I18N | Keywords: | has-patch commit |
Cc: | lmoffereins@… |
Description
In bp-xprofile/admin/js/admin.js
the add_option
function creates text nodes with untranslated strings:
txt1 = document.createTextNode( 'Default Value' ), toDeleteText = document.createTextNode( 'Delete' ),
Is there any reason why these are not translatable? Can we use wp_localize_script()
here?
Attachments (1)
Change History (9)
#1
@
9 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
#4
@
4 years ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Awaiting Contributions to 7.1.0
- Owner set to slaFFik
- Status changed from new to assigned
#5
@
4 years ago
- Keywords commit added
- Milestone changed from 7.1.0 to 8.0.0
Hi @slaFFik
Patch looks good. Thanks for your work on it. I'd just suggest to align the array items according to WPCS, this way:
'default_value' => __( 'Default Value', 'buddypress' ), 'delete' => __( 'Delete', 'buddypress' ),
We'll include this fix into 8.0.0 as it's not a regression from 7.0.0. Feel free to commit it in trunk 👍
Note: See
TracTickets for help on using
tickets.
Yes. It hasn't been done probably because we haven't noticed because this file is written with a distinct JS style that wasn't replicated anywhere else in BuddyPress (this was written probably six years ago).
The file is isolated enough to be re-written with better JS standards and we can absolutely make the string translatable then.