DataTables / DataTables/Plugins

Import dataTables translations with ES6

Open
#352 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

It could be possible:

  1. Get plugins package with nmp:
npm install datatables.net-plugins
  1. Create file, ex. translations.dataTables.js, with:
export function initDataTableTranslations() {
    return require('datatables.net-plugins/i18n/German.lang');
}
  1. And in another file:
import { initDataTableTranslations } from './translations.datatables.js'

But translation files have 'comments' at the beginning, and JSONs don't have comments, so this doesn't compile and the only option is to get it from cdn or make your own files.

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 with the translation files under datatables.net-plugins/i18n/, including German.lang, and inspect how their leading comments affect ES6 imports. Reproduce the failure using the npm installation and the sample initDataTableTranslations import; done means translation files can be imported without compilation errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, localization
Issue type
Feature
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.