Crowdin In-Context tool provides an overlay for your application. Translators and proofreaders can translate in context and preview completed translations instantly to see how they will be displayed in your application. You can use In-context for your web applications to help maintain the best translation quality.
In-Context localization is tied up with your Crowdin project, where translatable files are stored. Translations made using In-context will be added to your project the same way as translations made directly in the Editor.
This tool provides a view of your application with editable texts, so the translation process is real-time visible. Még az alkalmazás dinamikus része is és a helyőrzőket tartalmazó karakterláncok is lefordíthatók ezzel a módszerrel.
Crowdin In-Context works with the help of a one-line Javascript snippet and pseudo-language package. It creates a pseudo-language package based on the localization files uploaded to your project, which later will be integrated into your application as an additional localization language.
Integrated pseudo-language contains special identifiers instead of the original texts. Thus when switching your app to that language, all labels are converted to special identifiers. Javascript searches for those identifiers and replaces them with editable labels. So, the In-context page of your web app will look the same as your application, with the only difference that translatable strings will be editable.
Translations are made directly in the app, with no need to open the Editor. A simplified version of Crowdin Editor will be displayed, with all the functionality (TM, machine translation, approve/vote option, comments, terms) provided. Thus, it’s easier to make and review translations since translators can preview them in a real context.
Kétféle megközelítés van, hogy alkalmazása a Crowdin Szövegkörnyezeti honosítással integrált legyen:
Staging or translation environment If you are not planning to invite your end-users to help with translations or not considering using a “translation mode” in your production application, integrating Crowdin In-Context to your staging or dedicated translation app environment would be a good solution.
Production environment Crowdin In-Context doesn’t require any code changes in your application so that you can use it even on production. You decide how to turn it on and which segment of users will use it. The most common use cases are the following:
Follow the integration setup guide in your Crowdin project to set up In-context. To check out the guide, open your project and go to Tools > In-Context.
After the integration is successfully set up and you have refreshed your application, you should see the invitation dialog and Crowdin login box.
You can add these parameters to the _jipt
array in the configuration snippet.
_jipt.push(['preload_texts', true]);
Az összes forrásszöveg előre betöltésével gyorsítja a dinamikus tartalom megjelenítését a Szövegkörnyezeti eszközön belül. Automatically disabled for large projects (5000+ strings). Az elfogadható értékek: true, false.
_jipt.push(['touch_optimized', true]);
This option is enabled on touchscreens by default and makes the translation button next to each translatable string permanently visible instead of showing on hover. Az elfogadható értékek: true, false.
_jipt.push(['before_commit', function(source, translation, context, language_code) { return status_obj; }]);
Függvény a javaslat jóváhagyására a véglegesítés előtt.
Paraméterek | |
source | Forrásszöveg |
translation | Fordítási szöveg |
context | Forrás-karakterlánc szövegösszefüggés |
language_code | Célnyelv kódja (nyelvkódok) |
Visszatérési értékek | |
status_obj | Objektum. A status_obj.status "ok", "error" vagy "corrected" lehet. Hiba esetén a status_obj.message tartalmazza a hiba leírását. Ha az állapot "corrected", a status_obj.correction tartalmazza a korrigált fordítást |
_jipt.push(['before_dom_insert', function(text, node, attribute) { return 'text'; }]);
Függvény a karakterlánc átalakításához, mielőtt az a DOM-ba beillesztésre kerülne.
Paraméterek | |
text | Beillesztendő szöveg |
node opcionális | DOM elem, amelybe a szöveget be kell illeszteni. It may be omitted if the text doesn't have a target element (text inside the browser's pop-ups) |
attribute opcionális | The attribute of DOM element, if the text is part of an attribute |
Visszatérési értékek | |
text | Beillesztendő szöveg |
false | Ha a függvény false értéket ad vissza, a DOM nem lesz frissítve |
_jipt.push(['escape', function() { window.location.href = "http://app_domain.com"; }]);
If defined, users can close the In-Context overlay if they don’t want to translate. A saját oldalán vegye fel ezt a funkciót. Depending on the In-Context integration approach, it must change the app’s language or redirect from the translation environment to the production app.