Skip to content

In-page translation tool for projects that have translations in GlotPress

License

Notifications You must be signed in to change notification settings

Automattic/community-translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Community Translator

The Community Translator aims to be a front end tool for translations stored in GlotPress. It does so by providing on-screen translation ability, so that the community can easily fix a missing translation in-place and make use of the context in which the string appears.

Screenshot

Requirements

Build

To create the community-translator.js and community-translator.css files which should be loaded in the translatable site.

  • run npm install * run make.

You can also use fswatch-run lib css make to watch the directories lib and css for changed files and run make automatically.

Loading

The code in this repository is loaded by including the script as follows (generated above).

<head>[...]<link rel="stylesheet" type="text/css" href="community-translator.css" />[...]</head>
<!-- Page Content -->
<script type="text/javascript" src="community-translator.js"></script>
<script type="text/javascript">
<!-- server-side component output: translatorJumpstart = {...} -->
communityTranslator.load();
</script>

Note a server-side component is needed.

Translator Button

You might want to load the translator with a button, see the documentation about loading for details.

Debugging

Set or add community-translator to the debug value in localeStorage. i.e: localStorage.setItem( 'debug', 'community-translator' )

About

In-page translation tool for projects that have translations in GlotPress

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published