#7076 closed defect (bug) (fixed)
I18n: make XProfile admin js text nodes translatable
| Reported by: | Offereins | Owned by: | slaFFik |
|---|---|---|---|
| Priority: | normal | Milestone: | 8.0.0 |
| Component: | I18N | Version: | |
| Severity: | normal | 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)
#4
@
6 years ago
- Keywords has-patch added; needs-patch removed
- Milestone Awaiting Contributions → 7.1.0
- Owner set to
- Status new → assigned
#5
@
6 years ago
- Keywords commit added
- Milestone 7.1.0 → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.