-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normalize encoding and line endings ^2
- Loading branch information
Showing
32 changed files
with
6,835 additions
and
6,835 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
* text=auto eol=crlf | ||
*.rc text=auto charset=utf-8-sig | ||
*.rc text=auto eol=crlf charset=utf-8-sig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
name: Check Files | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'resources/lang/*.rc' | ||
pull_request: | ||
paths: | ||
- 'resources/lang/*.rc' | ||
|
||
jobs: | ||
check_files: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install dependencies | ||
run: npm install chardet | ||
|
||
- name: Run file checks | ||
run: node checkFiles.js | ||
name: Check Files | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'resources/lang/*.rc' | ||
pull_request: | ||
paths: | ||
- 'resources/lang/*.rc' | ||
|
||
jobs: | ||
check_files: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install dependencies | ||
run: npm install chardet | ||
|
||
- name: Run file checks | ||
run: node checkFiles.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
# ExplorerPatcher-L10N | ||
|
||
This repository contains the localization files for [ExplorerPatcher](https://github.com/valinet/ExplorerPatcher). The | ||
base English texts are available in the main repository under: | ||
|
||
* Properties Window, Notifications, and Crash | ||
Dialog: [ep_gui/resources/lang](https://github.com/valinet/ExplorerPatcher/tree/master/ep_gui/resources/lang) | ||
* Setup: [ep_setup/resources/lang](https://github.com/valinet/ExplorerPatcher/tree/master/ep_setup/resources/lang) | ||
|
||
## Contributing | ||
|
||
If you want to have ExplorerPatcher in your language and willing to maintain in the long run, or if you spot a mistake, | ||
an inaccuracy, or want to improve the translations of a language that you are fluent in, pull requests are very much | ||
appreciated. | ||
|
||
As we continually update the base English texts, we will add the new keys with English texts to the existing | ||
localization files regardless of the language, for the contributors to translate when possible. This is to keep | ||
ExplorerPatcher working as expected. | ||
|
||
It is preferred for translation contributors to be able | ||
to [compile ExplorerPatcher](https://github.com/valinet/ExplorerPatcher/wiki/Compiling) themselves in order to see the | ||
translations in action. If you are not able to do so, please mention it in your pull request and we will test and fix | ||
the translation files for you. | ||
|
||
Please make sure that the `.rc` files: | ||
* Are in UTF-8 encoding **with BOM**. | ||
* Have CRLF (`\r\n`) line endings. | ||
* Have double quotes `"` represented as double double quotes `""`. | ||
* Are properly formatted in the same way as the base English texts. | ||
|
||
## Acknowledgements | ||
|
||
We would like to thank the following people for their contributions in translating ExplorerPatcher: | ||
|
||
| Language | Contributor(s) | | ||
|-----------------------|-------------------------------------------------| | ||
| Chinese (Simplified) | @zetaloop, @FrzMtrsprt, @Yukari316 | | ||
| Chinese (Traditional) | @snowlinouo, @Corporation001 | | ||
| Dutch | @GewoonIraj | | ||
| French | @corentios, @Need74 | | ||
| German | @lukinator01, @NotOfficer | | ||
| Hungarian | @RedyAu | | ||
| Indonesian | @Antonomasia, @Amrsatrio | | ||
| Japanese | @creeper-0910, @reindex-ot, @Rukoto, @Amrsatrio | | ||
| Korean | @MuscularPuky | | ||
| Lithuanian | @Kass401 | | ||
| Polish | @BestiaPL | | ||
| Romanian | @21124637 | | ||
| Russian | @the-aLeXiS | | ||
| Turkish | @Akif9748 | | ||
| Ukrainian | @AyzekUorren | | ||
# ExplorerPatcher-L10N | ||
|
||
This repository contains the localization files for [ExplorerPatcher](https://github.com/valinet/ExplorerPatcher). The | ||
base English texts are available in the main repository under: | ||
|
||
* Properties Window, Notifications, and Crash | ||
Dialog: [ep_gui/resources/lang](https://github.com/valinet/ExplorerPatcher/tree/master/ep_gui/resources/lang) | ||
* Setup: [ep_setup/resources/lang](https://github.com/valinet/ExplorerPatcher/tree/master/ep_setup/resources/lang) | ||
|
||
## Contributing | ||
|
||
If you want to have ExplorerPatcher in your language and willing to maintain in the long run, or if you spot a mistake, | ||
an inaccuracy, or want to improve the translations of a language that you are fluent in, pull requests are very much | ||
appreciated. | ||
|
||
As we continually update the base English texts, we will add the new keys with English texts to the existing | ||
localization files regardless of the language, for the contributors to translate when possible. This is to keep | ||
ExplorerPatcher working as expected. | ||
|
||
It is preferred for translation contributors to be able | ||
to [compile ExplorerPatcher](https://github.com/valinet/ExplorerPatcher/wiki/Compiling) themselves in order to see the | ||
translations in action. If you are not able to do so, please mention it in your pull request and we will test and fix | ||
the translation files for you. | ||
|
||
Please make sure that the `.rc` files: | ||
* Are in UTF-8 encoding **with BOM**. | ||
* Have CRLF (`\r\n`) line endings. | ||
* Have double quotes `"` represented as double double quotes `""`. | ||
* Are properly formatted in the same way as the base English texts. | ||
|
||
## Acknowledgements | ||
|
||
We would like to thank the following people for their contributions in translating ExplorerPatcher: | ||
|
||
| Language | Contributor(s) | | ||
|-----------------------|-------------------------------------------------| | ||
| Chinese (Simplified) | @zetaloop, @FrzMtrsprt, @Yukari316 | | ||
| Chinese (Traditional) | @snowlinouo, @Corporation001 | | ||
| Dutch | @GewoonIraj | | ||
| French | @corentios, @Need74 | | ||
| German | @lukinator01, @NotOfficer | | ||
| Hungarian | @RedyAu | | ||
| Indonesian | @Antonomasia, @Amrsatrio | | ||
| Japanese | @creeper-0910, @reindex-ot, @Rukoto, @Amrsatrio | | ||
| Korean | @MuscularPuky | | ||
| Lithuanian | @Kass401 | | ||
| Polish | @BestiaPL | | ||
| Romanian | @21124637 | | ||
| Russian | @the-aLeXiS | | ||
| Turkish | @Akif9748 | | ||
| Ukrainian | @AyzekUorren | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,61 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const chardet = require('chardet'); | ||
|
||
const checkFileEncodingAndLineEndings = (filepath) => { | ||
// Check encoding | ||
const encoding = chardet.detectFileSync(filepath); | ||
if (encoding !== 'UTF-8' && encoding !== 'UTF-8-BOM') { | ||
console.log(`File ${filepath} is not UTF-8 with BOM.`); | ||
return false; | ||
} | ||
|
||
// Check for BOM | ||
const fileContent = fs.readFileSync(filepath); | ||
if (!fileContent.slice(0, 3).equals(Buffer.from([0xEF, 0xBB, 0xBF]))) { | ||
console.log(`File ${filepath} does not have BOM.`); | ||
return false; | ||
} | ||
|
||
// Check line endings | ||
const content = fileContent.toString('utf8'); | ||
if (content.indexOf('\r\n') === -1) { | ||
console.log(`File ${filepath} does not have CRLF line endings.`); | ||
return false; | ||
} | ||
|
||
return true; | ||
}; | ||
|
||
const main = () => { | ||
const baseDir = 'resources/lang'; | ||
let allFilesValid = true; | ||
|
||
const walkSync = (dir, filelist = []) => { | ||
fs.readdirSync(dir).forEach(file => { | ||
const filepath = path.join(dir, file); | ||
if (fs.statSync(filepath).isDirectory()) { | ||
filelist = walkSync(filepath, filelist); | ||
} else { | ||
filelist.push(filepath); | ||
} | ||
}); | ||
return filelist; | ||
}; | ||
|
||
const rcFiles = walkSync(baseDir).filter(file => file.endsWith('.rc')); | ||
|
||
rcFiles.forEach(file => { | ||
if (!checkFileEncodingAndLineEndings(file)) { | ||
allFilesValid = false; | ||
} | ||
}); | ||
|
||
if (!allFilesValid) { | ||
process.exit(1); | ||
} else { | ||
console.log("All .rc files have the correct encoding and line endings."); | ||
} | ||
}; | ||
|
||
main(); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const chardet = require('chardet'); | ||
|
||
const checkFileEncodingAndLineEndings = (filepath) => { | ||
// Check encoding | ||
const encoding = chardet.detectFileSync(filepath); | ||
if (encoding !== 'UTF-8' && encoding !== 'UTF-8-BOM') { | ||
console.log(`File ${filepath} is not UTF-8 with BOM.`); | ||
return false; | ||
} | ||
|
||
// Check for BOM | ||
const fileContent = fs.readFileSync(filepath); | ||
if (!fileContent.slice(0, 3).equals(Buffer.from([0xEF, 0xBB, 0xBF]))) { | ||
console.log(`File ${filepath} does not have BOM.`); | ||
return false; | ||
} | ||
|
||
// Check line endings | ||
const content = fileContent.toString('utf8'); | ||
if (content.indexOf('\r\n') === -1) { | ||
console.log(`File ${filepath} does not have CRLF line endings.`); | ||
return false; | ||
} | ||
|
||
return true; | ||
}; | ||
|
||
const main = () => { | ||
const baseDir = 'resources/lang'; | ||
let allFilesValid = true; | ||
|
||
const walkSync = (dir, filelist = []) => { | ||
fs.readdirSync(dir).forEach(file => { | ||
const filepath = path.join(dir, file); | ||
if (fs.statSync(filepath).isDirectory()) { | ||
filelist = walkSync(filepath, filelist); | ||
} else { | ||
filelist.push(filepath); | ||
} | ||
}); | ||
return filelist; | ||
}; | ||
|
||
const rcFiles = walkSync(baseDir).filter(file => file.endsWith('.rc')); | ||
|
||
rcFiles.forEach(file => { | ||
if (!checkFileEncodingAndLineEndings(file)) { | ||
allFilesValid = false; | ||
} | ||
}); | ||
|
||
if (!allFilesValid) { | ||
process.exit(1); | ||
} else { | ||
console.log("All .rc files have the correct encoding and line endings."); | ||
} | ||
}; | ||
|
||
main(); |
Oops, something went wrong.