Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from mapachurro/i18n-dev-1
Browse files Browse the repository at this point in the history
I18n implementation
  • Loading branch information
mapachurro authored Jul 22, 2024
2 parents 43c4978 + 0ba704c commit 44fedf9
Show file tree
Hide file tree
Showing 98 changed files with 30,295 additions and 21,982 deletions.
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
}

12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": [
"react-app",
"react-app/jest",
"plugin:prettier/recommended"
],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error"
}
}

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
^v21.1.0
109 changes: 0 additions & 109 deletions .package-lock.json

This file was deleted.

38 changes: 38 additions & 0 deletions data/sortterms.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// This script is used to sort terms.json in alphabetical order.

const fs = require('fs');
const path = require('path');

const filePath = path.join(__dirname, 'terms.json');

// Read the JSON file
fs.readFile(filePath, 'utf8', (err, data) => {
if (err) {
console.error('Error reading the file:', err);
return;
}

// Parse the JSON data
let termsData = JSON.parse(data);

// Extract terms object
let terms = termsData[0].terms;

// Sort the terms alphabetically by the term key
let sortedTerms = Object.keys(terms).sort().reduce((acc, key) => {
acc[key] = terms[key];
return acc;
}, {});

// Update the terms data with the sorted terms
termsData[0].terms = sortedTerms;

// Write the sorted JSON back to the file
fs.writeFile(filePath, JSON.stringify(termsData, null, 2), 'utf8', (err) => {
if (err) {
console.error('Error writing the file:', err);
return;
}
console.log('Terms sorted and saved successfully.');
});
});
Loading

0 comments on commit 44fedf9

Please sign in to comment.