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

feat: generate and upload crowdin glossary #252

Merged
merged 13 commits into from
Mar 26, 2018

Conversation

zeke
Copy link
Contributor

@zeke zeke commented Feb 22, 2018

Resolves #82

This PR uses the globals npm module and Electron's structured API data to assemble a list of glossary terms to give translators more context, and help them avoid translating things that should remain untouched.

What's in the glossary?

  • JavaScript builtins like Array, Map, String, etc
  • Electron APIs like BrowserWindow and MenuItem
  • Electron API Structures like MimeTypedBuffer and MemoryInfo
  • Electron instance methods like contents.openDevTools
  • Electron instance properties like contents.devToolsWebContents

There's other stuff in both globals (like globals.browser) and electron-api.json (like instance events) that we can squeeze into the glossary, but this is a start.

For those with admin access to Crowdin you can see the glossary entries here: https://crowdin.com/project/electron/settings#glossary

What translators see

Here's what the glossary entries look like in the translation interface:

screen shot 2018-02-22 at 3 10 18 pm

Caveats

  • The glossary entries are NOT case sensitive, so buffer is emphasized in the GUI even though the entry is Buffer.
  • I ended up choosing wording that accounts for cases where the given word should actually be translated. Hence the wording in the descriptions is "and should usually not be translated".

Bonus

Whenever this script is run, it updates any existing entries in the glossary, rather than creating duplicate entries. That means we can keep refining and publishing this without worrying about the effect it will have on existing entries.

@zeke zeke requested a review from vanessayuenn February 22, 2018 23:08
@zeke zeke force-pushed the generate-and-upload-crowdin-glossary branch from cc719df to 84a921a Compare February 23, 2018 21:37
@zeke
Copy link
Contributor Author

zeke commented Feb 23, 2018

Made a few updates to separate building the glossary from uploading it. Also added some tests to make sure our glossary data is valid.

@zeke
Copy link
Contributor Author

zeke commented Feb 23, 2018

test/glossary.js Outdated
])
})

it('does not allow commas in descriptions (for CSV purposes)', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@ckerr ckerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like both glosssary.json and glossary.csv are generated files, so do they need to in the repo? It doesn't seem to add any benefit, and has the cost of having to keep them up-to-date in the repo.

@zeke
Copy link
Contributor Author

zeke commented Feb 24, 2018

Now includes terms from electron/docs/glossary.md too, like ASAR, DMG, IPC, OSR, Brightray, etc.

screen shot 2018-02-23 at 6 39 02 pm

@zeke zeke changed the title generate and upload crowdin glossary [WIP] generate and upload crowdin glossary Feb 25, 2018
@zeke zeke force-pushed the generate-and-upload-crowdin-glossary branch from a6df90a to 18051f0 Compare March 22, 2018 20:35
@zeke zeke changed the title [WIP] generate and upload crowdin glossary generate and upload crowdin glossary Mar 22, 2018
@zeke
Copy link
Contributor Author

zeke commented Mar 22, 2018

Hey @ckerr and @vanessayuenn I dusted this off and got the tests passing. Can you take another look?

@zeke zeke changed the title generate and upload crowdin glossary feat: generate and upload crowdin glossary Mar 26, 2018
@zeke zeke merged commit 5b14f6a into master Mar 26, 2018
@zeke zeke deleted the generate-and-upload-crowdin-glossary branch March 26, 2018 22:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants