Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EVO-972] Add Translations #1385

Merged
merged 78 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
beafd50
React.lazy loads HyloEditorMobile and moves it above our routing setu…
lorenjohnson Oct 21, 2022
971fbb0
Merge branch 'ssr-code-splitting-and-redux-tidy' into improve-mobile-…
lorenjohnson Oct 24, 2022
5bd9a6e
Merge branch 'ssr-code-splitting-and-redux-tidy' into improve-mobile-…
lorenjohnson Oct 24, 2022
3596b85
Removes HyloEditor dependency on store for Mobile use
lorenjohnson Oct 31, 2022
8aa6d18
Merge branch 'HyloApp-544-add-group-explore-and-about' into improve-m…
lorenjohnson Oct 31, 2022
2b86996
Adds an isolated Feature / ReactPlayer route for HyloApp WebView use
lorenjohnson Oct 31, 2022
6d790a3
fix code style complaints, make english the default language
Sofacosta Dec 6, 2022
54ebf6b
additional translations, configure translation extractor
Sofacosta Dec 7, 2022
8350af9
suppress test warnings
Sofacosta Dec 7, 2022
6f26f97
additional translations
Sofacosta Dec 7, 2022
0e7bd0c
Additional translations
Sofacosta Dec 14, 2022
5119f38
translation cleanup
Sofacosta Dec 14, 2022
cee112d
comment out temporarily unused import
Sofacosta Dec 15, 2022
5102fe7
additional translations
Sofacosta Dec 19, 2022
1351c37
additional translations
Sofacosta Dec 21, 2022
3c925a1
additional translations
Sofacosta Dec 22, 2022
b7e0b14
fix typo
Sofacosta Dec 22, 2022
1f063ea
fix typos
Sofacosta Dec 22, 2022
2058306
additional translations
Sofacosta Dec 27, 2022
cbcdbfb
update snapshot
Sofacosta Dec 27, 2022
5b6d2a4
update snapshot
Sofacosta Dec 27, 2022
8b8268c
additional translations
Sofacosta Dec 28, 2022
6ac4446
additional translations
Sofacosta Dec 29, 2022
15310aa
update test
Sofacosta Dec 29, 2022
027c9e9
update translation, update translations.json
Sofacosta Dec 29, 2022
69a4cb3
address PR comments
Sofacosta Jan 9, 2023
cf000ff
update snapshots
Sofacosta Jan 9, 2023
df54462
Merge branch 'dev' into evo-972/translations
thomasgwatson Mar 20, 2023
1da35f3
this.props.t => t
thomasgwatson Mar 20, 2023
061c3d2
Pull stylings out of translations
thomasgwatson Mar 21, 2023
f9e980a
Updated tests for i18n
thomasgwatson Mar 21, 2023
692dc76
First wave of removing all TODO: i18n
thomasgwatson Mar 22, 2023
b8d5f5a
Another round of removing styling from i18n
thomasgwatson Mar 22, 2023
3a06d7d
Add en translation and i18n config
thomasgwatson Mar 24, 2023
44f191b
Add auto-generated es locale translations
thomasgwatson Mar 24, 2023
f66a99a
Remove comment from vscode setup
thomasgwatson Mar 24, 2023
b8aa79f
Add language detection and selector
thomasgwatson Mar 30, 2023
52da43e
Fix variable in translation
thomasgwatson Mar 30, 2023
c7d6c6b
Merge branch 'improve-mobile-editor-performance' into evo-972/transla…
Mar 31, 2023
9fdd6ce
Upgrade off beta of TipTap to 2.0.1 to resolve some drifting dependen…
lorenjohnson Mar 31, 2023
9d165cf
Add locale sync on user load
thomasgwatson Mar 31, 2023
80c9b3c
Remove extraneous package-lock
lorenjohnson Apr 3, 2023
d77e1c4
Fix mis addressed t() calls, linting
lorenjohnson Apr 3, 2023
60bb972
Fix tests
lorenjohnson Apr 3, 2023
8ec60ed
Merge branch 'evo-972/translations' into evo-1475-locale-detector
thomasgwatson Apr 3, 2023
cbe0f02
Merge pull request #1489 from Hylozoic/evo-1475-locale-detector
thomasgwatson Apr 4, 2023
ce64be4
Fix yarn.lock
tibetsprague Apr 4, 2023
bc82776
Revert "Fix yarn.lock"
tibetsprague Apr 4, 2023
21fa3f0
Fix some more translations
tibetsprague Apr 11, 2023
e5d86ab
Fixes broken environment
tibetsprague Apr 11, 2023
10a2398
More translation fixes
tibetsprague Apr 11, 2023
4904ab9
Fix yarn.lock
tibetsprague Apr 12, 2023
2d3bf8c
Try to fix deployment to heroku
tibetsprague Apr 12, 2023
f4d56be
Still trying to fix builds
tibetsprague Apr 13, 2023
0c308e5
Maybe actually fix builds
tibetsprague Apr 13, 2023
032ceb4
Correct variables in ES local
thomasgwatson Apr 17, 2023
b0fd735
Fix translations for group navigation
thomasgwatson Apr 17, 2023
fdaeb03
Merge pull request #1496 from Hylozoic/EVO-1492-i18n-fixes
thomasgwatson Apr 18, 2023
b2ab875
23-04-23 es locale update
thomasgwatson Apr 24, 2023
9ca592a
Update tests
thomasgwatson Apr 25, 2023
4aab815
Fix i18n for create modal
thomasgwatson Apr 26, 2023
a4cbcb6
i18n tweak
thomasgwatson Apr 26, 2023
8312d00
Finished -Handle this translation- TODOs
thomasgwatson Apr 27, 2023
d247b24
Fix login errors
thomasgwatson Apr 27, 2023
6b4db36
Fixed translation
thomasgwatson Apr 27, 2023
5eaf417
Fix strings in inviteTab
thomasgwatson Apr 28, 2023
9f17d26
Pedro deep review i18n
thomasgwatson May 1, 2023
f9d602d
Merge branch 'dev' into evo-972/translations
thomasgwatson May 2, 2023
ac1181a
Update snapshots
thomasgwatson May 2, 2023
01137e7
Fix lint issues
tibetsprague May 3, 2023
db50ddd
Fix error when filtering groups on map by topic and group has blank d…
tibetsprague May 3, 2023
dfcce11
Fix create-role text
thomasgwatson May 8, 2023
27ad964
Fix overflow in group sidebar
thomasgwatson May 8, 2023
6b090d8
Fix farm filters
thomasgwatson May 8, 2023
68e0867
Merge branch 'dev' into evo-972/translations
thomasgwatson May 8, 2023
2303b2c
Fix stream sort options
thomasgwatson May 12, 2023
dc20c32
Fix notification selection text
thomasgwatson May 12, 2023
fdb69cc
Fix visibility string and description texts
thomasgwatson May 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 19 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,23 @@
"eslint.format.enable": true,
"eslint.packageManager": "yarn",
"eslint.lintTask.enable": true,
"eslint.codeActionsOnSave.mode": "problems"
"eslint.codeActionsOnSave.mode": "problems",
"i18n-ally.localesPaths": [
"public/locales"
],
"i18n-ally.enabledFrameworks": [
"react",
"i18next",
"general"
],
"i18n-ally.namespace": true,
"i18n-ally.sourceLanguage": "en",
"i18n-ally.displayLanguage": "en",
"i18n-ally.sortKeys": true,
"i18n-ally.disablePathParsing": true,
"i18n-ally.pathMatcher": "{locale}.json",
"i18n-ally.extract.ignored": [
"A role must have a valid emoji and name to be updated"
],
"i18n-ally.keystyle": "flat"
}
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ For users that are not logged in can see public posts and groups via routes like
`/groups/:groupSlug/:view/post/:postId` => `/post/:postId`
`/public/post/:postId` => `/post/:postId`

### Translations
We use i18next to handle translations of platform strings (no translations of user content at this time).

The `i18next-extract` config details in the `babel.config.js` file determines how all language keys are extracted and what languages are supported. Whenever babel runs, it will comb the entire repo for js/jsx files, and anytime it finds a t('example-key') function, it will pull every key into each of the translation files. It is disabled in the babel.config by default: when it runs, it generates keys for missing translations. It also sometimes overwrites newly added translations, causing a lot of finicky editing if its on by default. When you add a new translation, uncomment the config, restart webpack (yarn start) and it should pick up the key for every locale file.

If using vscode, there is a really fantastic extension for working with i18n; [i18n-ally](https://github.com/lokalise/i18n-ally)
They have a 8 minute setup and feature [demo video](https://www.youtube.com/watch?v=kowM-MoGVns).


### Sockets

Chat, in-app notifications and comments use sockets to update users in real-time. In the future, new posts will also use sockets to show up in real-time.
Expand Down
14 changes: 14 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ module.exports = function (api) {
extensions: ['.graphql']
}
],
/*
Disabling this by default: when it runs, it generates keys for missing translations
It also sometimes overwrites newly added translations, causing a lot of finicky editing.
When you add a new translation, uncomment the below config, restart webpack (yarn start) and it should pick up the key for every locale file
*/
// [
// 'i18next-extract',
// {
// keySeparator: null,
// locales: ['es', 'en'],
// nsSeparator: null,
// outputPath: 'public/locales/{{locale}}.json'
// }
// ],
'import-graphql',
'inline-import',
'lodash'
Expand Down
36 changes: 21 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"browserslist": [
"defaults"
],
],
"proxy": "localhost:3001",
"scripts": {
"dev": "yarn start",
Expand Down Expand Up @@ -49,11 +49,11 @@
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "7.16.11",
"@babel/preset-react": "^7.16.7",
"@deck.gl/core": "^8.7",
"@deck.gl/geo-layers": "^8.7",
"@deck.gl/layers": "^8.7",
"@deck.gl/mesh-layers": "^8.7",
"@deck.gl/react": "^8.7",
"@deck.gl/core": "8.8.27",
"@deck.gl/geo-layers": "8.8.27",
"@deck.gl/layers": "8.8.27",
"@deck.gl/mesh-layers": "8.8.27",
"@deck.gl/react": "8.8.27",
"@emoji-mart/react": "^1.0.1",
"@faker-js/faker": "^6.0.0-alpha.5",
"@loaders.gl/core": "^3.2.0",
Expand All @@ -64,13 +64,14 @@
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0-beta.14",
"@tiptap/extension-highlight": "^2.0.0-beta.199",
"@tiptap/extension-link": "^2.0.0-beta.199",
"@tiptap/extension-mention": "^2.0.0-beta.199",
"@tiptap/extension-placeholder": "^2.0.0-beta.199",
"@tiptap/react": "^2.0.0-beta.199",
"@tiptap/starter-kit": "^2.0.0-beta.199",
"@tiptap/suggestion": "^2.0.0-beta.199",
"@tiptap/extension-highlight": "2.0.1",
"@tiptap/extension-link": "2.0.1",
"@tiptap/extension-mention": "2.0.1",
"@tiptap/extension-placeholder": "2.0.1",
"@tiptap/pm": "2.0.1",
"@tiptap/react": "2.0.1",
"@tiptap/starter-kit": "2.0.1",
"@tiptap/suggestion": "2.0.1",
"@turf/area": "^6.0.1",
"@turf/bbox": "^6.0.1",
"@turf/bbox-polygon": "^6.0.1",
Expand All @@ -89,6 +90,7 @@
"babel-jest": "^27.5.1",
"babel-loader": "8.2.3",
"babel-plugin-data-stylename": "0.1.1",
"babel-plugin-i18next-extract": "^0.9.0",
"babel-plugin-import-graphql": "^2.8.1",
"babel-plugin-inline-import": "^3.0.0",
"babel-plugin-lodash": "^3.3.4",
Expand All @@ -98,7 +100,7 @@
"babel-preset-react-app": "^10.0.1",
"bfj": "6.1.1",
"bootstrap": "4.0.0-alpha.6",
"browserslist": "^4.21.2",
"browserslist": "^4.21.5",
"case-sensitive-paths-webpack-plugin": "2.2.0",
"chalk": "2.3.0",
"cheerio": "^1.0.0-rc.10",
Expand Down Expand Up @@ -151,6 +153,9 @@
"http-proxy-middleware": "0.17.4",
"husky": "^7.0.4",
"hylo-shared": "5.2.2",
"i18next": "^22.0.5",
"i18next-browser-languagedetector": "^7.0.1",
"i18next-http-backend": "^2.0.1",
"identity-obj-proxy": "3.0.0",
"immutability-helper": "^3.1.1",
"immutable": "~3.7.4",
Expand All @@ -167,7 +172,7 @@
"json-loader": "0.5.7",
"lodash": "~4.17.21",
"lru-cache": "^4.1.1",
"mapbox-gl": "^2.7.1",
"mapbox-gl": "2.10.0",
"mime": "^2.0.3",
"mini-css-extract-plugin": "0.5.0",
"mixpanel-browser": "^2.45.0",
Expand Down Expand Up @@ -210,6 +215,7 @@
"react-dom": "^16.8.6",
"react-flip-move": "^3.0.4",
"react-helmet": "^6.1.0",
"react-i18next": "^12.0.0",
"react-icons": "^4.4.0",
"react-joyride": "^2.3.2",
"react-map-gl": "^6",
Expand Down
Loading