Skip to content

Commit

Permalink
Workaround for bidi related mojibake in Edge #8
Browse files Browse the repository at this point in the history
  • Loading branch information
tsjensen committed Jul 25, 2018
1 parent 395c50c commit 904eed1
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 9 deletions.
11 changes: 11 additions & 0 deletions l20n-mojibake-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- build/l20n/l20n.js
+++ build/l20n/l20n.js
@@ -5063,7 +5063,7 @@ function getMeta(head) {
// used to create new `MessageContext` objects for a given `lang` with selected
// builtin functions.
function createContext(lang) {
- return new MessageContext(lang);
+ return new MessageContext(lang, { "useIsolating": false });
}

// Called for every named Localization declared via <link name=…> elements.
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
"name": "civbuddy",
"version": "2.3.3",
"description": "A calculator app for players of Francis Tresham's original Civilization board game (1980)",
"keywords": [
"board-game",
"civilization",
"francis-tresham"
],
"keywords": ["board-game", "civilization", "francis-tresham"],
"homepage": "https://civbuddy.org/",
"bugs": {
"url": "https://github.com/tsjensen/civbuddy/issues"
Expand All @@ -18,7 +14,7 @@
"repository": "github:tsjensen/civbuddy",
"scripts": {
"prebuild": "copyfiles -f resources/version.json build/",
"build": "npm-run-all --parallel --silent html-template:* sass tslint",
"build": "npm-run-all --parallel --silent fix-l20n html-template:* sass tslint",
"html-template:index": "htmlprocessor resources/index.html -o build/dist/index.html",
"posthtml-template:index": "replace @@pageName@@ games build/dist/index.html -q",
"html-template:players": "htmlprocessor resources/players.html -o build/dist/players.html",
Expand All @@ -30,6 +26,9 @@
"html-template:error": "htmlprocessor resources/error.html -o build/dist/error.html",
"posthtml-template:error": "replace @@pageName@@ error build/dist/error.html -q",
"sass": "node-sass --source-map=true src/sass -o build/dist/css/",
"prefix-l20n": "rimraf build/l20n && copyfiles -f node_modules/l20n/dist/web/l20n.js build/l20n",
"fix-l20n": "apply-patch l20n-mojibake-fix.patch",
"postfix-l20n": "uglifyjs build/l20n/l20n.js -m -c -o build/l20n/l20n.min.js",
"postbuild": "cross-env TS_NODE_PROJECT=tsconfig-for-webpack-config.json webpack",
"prehash": "hashmark -l 12 -r --cwd build/dist/css {civbuddy,cards,games,error,funds,players}.css {name}.{hash}{ext} | replaceinfiles --silent --source build/dist/*.html",
"hash": "hashmark -l 12 -r --cwd build/dist/js {bootstrap.min,civbuddy,l20n.min}.js {name}.{hash}{ext} | replaceinfiles --silent --source build/dist/*.html",
Expand Down Expand Up @@ -62,6 +61,7 @@
"@types/sprintf-js": "1.1.0",
"@types/uuid": "3.4.3",
"@types/webpack": "3.8.8",
"apply-patch": "0.1.2",
"chai": "4.1.2",
"copy-webpack-plugin": "4.4.1",
"copyfiles": "1.2.0",
Expand All @@ -84,6 +84,7 @@
"tsconfig-paths": "3.1.1",
"tslint": "5.9.1",
"typescript": "2.8.1",
"uglify-js": "^2.8.22",
"webpack": "3.11.0",
"webpack-version-file-plugin": "0.3.1"
}
Expand Down
6 changes: 3 additions & 3 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ const config: webpack.Configuration = {
{ from: 'node_modules/bootstrap/dist/js/bootstrap.min.js', to: 'build/dist/js' },
{ from: 'node_modules/open-iconic/font/css/open-iconic-bootstrap.min.css', to: 'build/dist/css' },
{ from: 'node_modules/open-iconic/font/fonts', to: 'build/dist/fonts' },
{ from: 'node_modules/l20n/dist/web/l20n.min.js', to: 'build/dist/js' }
{ from: 'build/l20n/l20n.min.js', to: 'build/dist/js' }
], {
copyUnmodified: false
})
copyUnmodified: false
})
],
resolve: {
extensions: ['.ts', '.js']
Expand Down

0 comments on commit 904eed1

Please sign in to comment.