Skip to content

How to translate AVideo Platform to your idiom using google translate

Daniel Neto edited this page Jul 7, 2024 · 3 revisions

How to Translate AVideo Platform Using Google Translate

This tutorial will guide you through translating the AVideo Platform into your desired language using Google Translate. If you prefer a video format, we have this tutorial in video format, which is based on a newer version with some additional features that make the process easier.

However, if you don't mind reading a bit more, continue with this written guide.

Steps to Translate AVideo Platform

1. Access the Locale Page

  • Open your web browser and go to the locale page of your AVideo Platform instance:
    [url to your AVideo Platform instance]/locale
    
  • You can also use the demo page: AVideo Demo Locale Page

2. Copy the Original Text

  • On the locale page, copy all lines from the first column (use Ctrl+C).

Copy Original Text

3. Translate the Text

  • Open Google Translate and paste the copied content into the translation box.
  • Select the target language for translation. In this example, we are translating to Spanish.

Translate Text

4. Copy the Translated Text Back

  • Copy all the translated lines from Google Translate.

Copy Translated Text

5. Create a Translation File

  • Go back to your AVideo Platform and paste the translated content back into the site.
  • The content will automatically be transformed into a PHP array.
  • Save the translated array into a file named according to the locale of the translation (e.g., locale/es.php for Spanish).

6. Manually Adding Translations on AVideo

All language files are located in the folder AVideo/locale/. Here is an example of the files you might find:

Language File Name
Arabic (Saudi) ar_SA.php
Czech cs.php
Danish (Denmark) da_DK.php
German de.php
Greek (Greece) el_GR.php
English (Australia) en_AU.php
English (US) en_US.php
Spanish es.php
Spanish (Chile) es_CL.php
French fr.php
Hebrew (Israel) he_IL.php
Hindi (India) hi_IN.php
Hungarian hu_HU.php
Italian it.php
Japanese (Japan) ja_JP.php
Korean (Korea) ko_KR.php
Dutch (Netherlands) nl.php
Polish pl.php
Portuguese pt.php
Portuguese (Brazil) pt_BR.php
Russian ru.php
Sinhala si.php
Swedish (Sweden) sv_SE.php
Thai th.php
Turkish tr.php
Chinese zh.php
Chinese (Traditional, Taiwan) zh_Hant_TW.php

Creating New Language Files

To create a new language file:

  1. Navigate to the AVideo/locale/ directory.
  2. Create a new PHP file with the appropriate locale name (e.g., locale/fr_CA.php for Canadian French).

Adding Translations

Each language file contains an associated array with respective translations. For example, in the de.php (German) file, you will find:

<?php
global $t;

$t['%d Users linked'] = '%d verknüpfte Benutzer';
$t['%s Ago'] = 'Vor %s';
$t['%s ERROR: You must set a KEY on config'] = '%s ERROR: Du musst einen KEY (Schlüssel) in der config generieren';
$t['%s ERROR: You must set an ID on config'] = '%s FEHLER: Du musst eine ID in der config erstellen';
$t['%s ago'] = 'vor %s';
$t['(filtered from _MAX_ total entries)'] = '(gefiltert von _MAX_ total Einträgen)';
$t['465 OR 587'] = '465 oder 587';
// ... additional translations
?>

To add new translations:

  1. Copy the original English text from en_US.php.
  2. Translate each line into your target language.
  3. Add each translated line into the new language file in the same format as shown above.

Contributing to the AVideo Repository

If you modify or add a new translation, consider contributing your work back to the AVideo community by making a pull request to the main AVideo repository. Here’s how to do it:

  1. Fork the Repository:

    • Go to the AVideo GitHub repository and click the "Fork" button to create a copy of the repository in your GitHub account.
  2. Clone the Repository:

    • Clone your forked repository to your local machine using the following command:
      git clone https://github.com/your-username/AVideo.git
    • Replace your-username with your GitHub username.
  3. Create a New Branch:

    • Create a new branch for your translation work:
      git checkout -b add-translation-your-language
  4. Add Your Translations:

    • Navigate to the locale directory and add your new translation file or modify existing ones.
    • Commit your changes:
      git add locale/
      git commit -m "Added/Updated translation for [Your Language]"
  5. Push Your Changes:

    • Push your changes to your forked repository:
      git push origin add-translation-your-language
  6. Create a Pull Request:

    • Go to your forked repository on GitHub and click the "Compare & pull request" button.
    • Provide a description of your changes and submit the pull request.

By following these steps, you can translate the AVideo Platform into any language you need and contribute to the improvement of the platform for all users.

Clone this wiki locally