Meteor-Community-Packages / Meteor-Community-Packages/meteor-tabular

reactive translation

Open
#274 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
360
Forks
132
PR merge metrics
No merged PRs in 30d

Description

I am trying to translate the pagination the search,etc,but using the method from the docs its not reactive if i change the language it doesnt change the texts.I am using it like this.

``` javascript
Template.admin_users.onCreated(function () {
$.extend(true, $.fn.dataTable.defaults, {
language: {
"lengthMenu": TAPi18n.__("table_length"),
"zeroRecords": TAPi18n.__("table_zero_records"),
"info": TAPi18n.__("table_info"),
"infoEmpty": TAPi18n.__("table_zero_records"),
"infoFiltered": TAPi18n.__("table_info_filtered"),
"buttons": {
"print":TAPi18n.__("print"),
"copy":TAPi18n.__("copy"),
"colvis":TAPi18n.__("colvis"),
"copyTitle": TAPi18n.__("copy_title"),
"copyKeys": TAPi18n.__("copy_keys"),
}
},
"oLanguage": {
"oPaginate": {
"sNext": TAPi18n.__("next"),
"sPrevious": TAPi18n.__("previous")
},
"sEmptyTable": TAPi18n.__("table_zero_records"),
"sSearch": TAPi18n.__("search")
},
});
})
```

i actually managed to make the buttons reactive i added some functions to the package because datatables function text caused the buttons to disappear when i was changing the language but i cant manage to change the others without heavy manipulation of the dom.Is there a way to actually translate the pagination,search,etc?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the Template.admin_users.onCreated callback and the DataTables language configuration shown in the issue. Trace how TAPi18n.__(...) values are applied and compare that with the reactive button handling described by the reporter. Done means pagination, search, and related labels update when the language changes without heavy DOM manipulation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, internationalization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.