Crowdin In-Context tool allows to translate texts directly within the actual web application. In such a way, the best translation quality is maintained.
A localização da Tradução Contextual está vinculada ao projeto atual criado no Crowdin, no qual os ficheiros traduzíveis são armazenados.
Esta ferramenta torna todos os textos da aplicação Web, editáveis. Além disso, o processo de tradução é visível em tempo real. Até mesmo a parte dinâmica da aplicação e frases que contém espaços reservados, podem ser traduzidas desta maneira.
A Tradução Contextual do Crowdin funciona com a ajuda de um trecho de Javascript de linha e o pacote de pseudo-idioma. Ela cria o pacote de pseudo-idioma com base nos ficheiros de localização enviados para o teu projeto, que mais tarde, serão integrados na tua aplicação como um idioma de localização extra.
O pseudo-idioma integrado contém alguns identificadores especiais em vez dos textos originais, ao alternares a tua aplicação para esse idioma, todos os rótulos são convertidas em identificadores especiais. Javascript procura esses identificadores e os substitui pelos rótulos editáveis. De tal forma, o tradutor não, vê qualquer diferença entre a aplicação ao vivo em relação à que usa a ferramenta integrada de Tradução Contextual do Crowdin. No entanto, a ferramenta define qual parte da aplicação é traduzível e fornece todos os meios para permitir que o tradutor localize o contexto.
A tradução é feita no Editor do Crowdin regular minimizado com todas as funcionalidades (MT, tradução automática, opção de aprovação/voto, comentários, termos) fornecidas. Assim, é mais fácil rever as traduções para os revisores e assegurar a qualidade.
There are two common approaches to integrate Crowdin In-Context with your application:
Follow step by step the integration setup, which you can find in the Project Settings, In-Context tab.
After the successful integration and your app refreshment, you should see the invitation dialog and Crowdin login box.
You can add these parameters to _jipt
array in the configuration snippet.
_jipt.push(['preload_texts', true]);
Speeds up dynamic content displaying within the In-Context tool by preloading all source strings. Automatically disabled for the large projects (5000+ strings). Acceptable values: 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, as opposed to showing on hover. Acceptable values: true, false.
_jipt.push(['before_commit', function(source, translation, context, language_code) { return status_obj; }]);
Function to validate the suggestion before committing.
Parâmetros | |
source | Texto original |
translation | Translation text |
context | Source string context |
language_code | Target language code (language codes) |
Return Values | |
status_obj | Objeto. The status_obj.status may be "ok", "error" or "corrected". In case of error, status_obj.message contains error description. When status is "corrected", status_obj.correction contains the corrected translation |
_jipt.push(['before_dom_insert', function(text, node, attribute) { return 'text'; }]);
Function to transform the string before it gets inserted into the DOM.
Parâmetros | |
text | String for insertion |
node optional | DOM element in which the text must be inserted. May be omitted if text does not have target element (text inside browser's pop-ups) |
attribute optional | Attribute of DOM element, if the text is part of attribute |
Return Values | |
text | String for insertion |
false | If the function returns false, DOM will not be updated |
_jipt.push(['escape', function() { window.location.href = "http://app_domain.com"; }]);
If defined, users can close In-Context overlay if they don’t want to translate. Implement this feature on your side. It must change app’s language or redirect from translation environment to the production app, depending on the In-Context integration approach.