வலைபெயர்ப்பு cdn பயன்படுத்தி html மற்றும் சாவாச்கிரிப்ட் மொழிபெயர்ப்பு¶
வலைபெயர்ப்பு 4.2 உடன் தொடங்கி ஒரு சி.டி.என்-க்கு உள்ளூர்மயமாக்கலை ஏற்றுமதி செய்ய முடியும் சாவாச்கிரிப்ட் உள்ளூராக்கல் சி.டி.என் add-and.
Note
This feature is configured on Hosted Weblate. It requires additional
configuration on your installation, see LOCALIZE_CDN_URL and
LOCALIZE_CDN_PATH.
Upon installation into your component it will push committed translations (see சோம்பேறி கம்யூச்) to the CDN and these can be used in your web pages to localize them.
கூறு உருவாக்குதல்¶
First, you need to create a monolingual component which will hold your strings, see மொழிபெயர்ப்பு திட்டங்கள் மற்றும் கூறுகளைச் சேர்ப்பது for generic instructions on that.
In case you have existing repository to start with (for example the one
containing HTML files), create an empty JSON file in the repository for the
source language (see மூல மொழி), for example
locales/en.json. The content should be {} to indicate an empty
object. Once you have that, the repository can be imported into Weblate and you
can start with an add-on configuration.
Hint
உங்களிடம் ஏற்கனவே மொழிபெயர்ப்புகள் இருந்தால், அவற்றை சேஎச்ஓஎன் கோப்புகளில் வைக்கலாம், அவை வலைபெயர்ப்பில் பயன்படுத்தப்படும்.
For those who do not want to use existing repository (or do not have one), choose Start from scratch when creating component and choose JSON file as a file format (it is okay to choose any monolingual format at this point).
configuring வலைபெயர்ப்பு cdn add-on¶
தி சாவாச்கிரிப்ட் உள்ளூராக்கல் சி.டி.என் add-and சில உள்ளமைவு விருப்பங்களை வழங்குகிறது.
- மொழிபெயர்ப்பு வாசல்
இந்த வரம்புக்கு மேலே மொழிபெயர்க்கப்பட்ட மொழிபெயர்ப்புகள் cdn இல் சேர்க்கப்படும்.
- css தேர்வாளர்
Configures which strings from the HTML documents are translatable, see வலைபெயர்ப்பு cdn க்கான சரம் பிரித்தெடுத்தல் and வலைபெயர்ப்பு cdn பயன்படுத்தி html உள்ளூர்மயமாக்கல்.
- மொழி குக்கீ பெயர்
Name of cookie which contains user selected language. Used in the JavaScript snippet for வலைபெயர்ப்பு cdn பயன்படுத்தி html உள்ளூர்மயமாக்கல்.
- html கோப்புகளிலிருந்து சரங்களை பிரித்தெடுக்கவும்
List of files in the repository or URLs where Weblate will look for translatable strings and offer them for a translation, see வலைபெயர்ப்பு cdn க்கான சரம் பிரித்தெடுத்தல்.
வலைபெயர்ப்பு cdn க்கான சரம் பிரித்தெடுத்தல்¶
The translation strings have to be present in Weblate. You can either manage these manually, use API to create them or list files or URLs using Extract strings from HTML files and Weblate will extract them automatically. The files have to present in the repository or contain remote URLs which will be download and parsed regularly by Weblate.
The default configuration for CSS selector extracts elements with
CSS class l10n, for example it would extract two strings from following
snippets:
<section class="content">
<div class="row">
<div class="wrap">
<h1 class="section-title min-m l10n">Maintenance in progress</h1>
<div class="page-desc">
<p class="l10n">We're sorry, but this site is currently down for maintenance.</p>
</div>
</div>
</div>
</section>
In case you don't want to modify existing code, you can also use * as a
selector to process all elements.
Note
தற்போது, தனிமங்களின் உரை மட்டுமே பிரித்தெடுக்கப்படுகிறது. குழந்தைகளுடன் உறுப்பு பண்புகள் அல்லது கூறுகளின் உள்ளூர்மயமாக்கலை இந்த துணை நிரல் ஆதரிக்காது.
வலைபெயர்ப்பு cdn பயன்படுத்தி html உள்ளூர்மயமாக்கல்¶
To localize a HTML document, you need to load the weblate.js script:
<script src="https://weblate-cdn.com/a5ba5dc29f39498aa734528a54b50d0a/weblate.js" async></script>
Upon loading, this will automatically find all matching translatable elements (based on CSS selector configuration) and replace their text with a translation.
பயனர் மொழி உள்ளமைக்கப்பட்ட குக்கீயிலிருந்து கண்டறியப்பட்டு உலாவியில் உள்ளமைக்கப்பட்ட பயனர் விரும்பும் மொழிகளுக்குத் திரும்புகிறது.
The Language cookie name can be useful for integration with other
applications (for example choose django_language when using Django).
javascript localization¶
தனிப்பட்ட மொழிபெயர்ப்புகள் cdn இன் கீழ் இருமொழி சாதொபொகு கோப்புகளாக வெளிப்படுத்தப்படுகின்றன. ஒன்றைப் பெற நீங்கள் பின்வரும் குறியீட்டைப் பயன்படுத்தலாம்:
fetch(("https://weblate-cdn.com/a5ba5dc29f39498aa734528a54b50d0a/cs.json")
.then(response => response.json())
.then(data => console.log(data));
இந்த வழக்கில் உண்மையான உள்ளூர்மயமாக்கல் தர்க்கத்தை செயல்படுத்த வேண்டும்.