Community Forum

User info

Welcome, Guest! Please login or register.


You are here » Community Forum » New Forum Features » WCF's translitejs for websites


WCF's translitejs for websites

Posts 1 to 21 of 21

1

Hey Гость guess what Tcigroup made what we call Translitejs A Simple JS library for all.

Installation Procedures

Step1: wrote:

Download or Link the Script
<script src="http://forumfiles.wap.sh/files/translitejs/v.1.0/translite.js"></script>

Download at http://wcoders.cf/pages/translitejs


Step2: wrote:

Load Languages
to do this call the $lang function
$lang(lang.format,arr.words)
E.g
$lang("en",new Array("hi","nice")

N/B:language format allowed are en,fr,ru,pt,yor,en_1,fr_1 and custom which can be any language.


Step3: wrote:

Set Your CLASS NAME
<div class="{name}">
hello
</div>

Now set $translite.id to {name}. If the class isnt set you can use translite as class name.


Step4: wrote:

Finish It Up
simply call $translite.tolang function at footer
$translite.tolang(to,from) //from isnt required
$translite.tolang("fr")


All together 1-4
<script src="http://forumfiles.wap.sh/files/translitejs/v.1.0/translite.js"></script>
<div class="translite">
hello
</div>
<script>
$lang()
$translite.tolang("fr")
</script>


Nice right well go on start using translitejs

Source: http://wcoders.cf/viewtopic.php?id=114#p236

Last edited by jonath45 (2018-01-24 23:14:00)

0

2

jonath45
Very Nice,,, but I still do not know how to call the translatejs via footer...
can you give me more example
For example:  if i want to translate the word>>  Last visit: into my language

0

3

To do this simply place in footer

<script>
$lang("en",new Array("Last Visit","Another Word Goes here"); //you can add as much as possible
//note translitejs will not overwrite so define at once
$lang("en_1",new Array("translation here","translation here also");
$translite.id = "punbb" //punbb is general class you can change it to "section" to affect section i.e footer header body or use Jquery to add class and set id to class
$translite.tolang("en_1"); //translate content
</script>

Last edited by jonath45 (2018-01-27 15:26:16)

0

4

which loads faster between the UniverChange script and your Translitejs ?

0

5

Translite will load does in as much as it is embedded and not placed in a button with onclick

0

6

i m missing somthing,, its not work for me
should i change the: http://forumfiles.wap.sh/files/translit … nslite.js:

Code:
 }   
} else {
$lang("en",new Array("hello","goodbye"));
$lang("fr",new Array("bonjour","au revoir"));
}
};

0

7

No dont the $lang() is meant to define some words only when it is empty.
check your codes translite does not overwrite a dictionary so check for traces of $lang() which has no variable defined

0

8

@kami drop your code ill be sure to look through it for any problem

0

9

jonath45 wrote:

To do this simply place in footer

    <script>
    $lang("en",new Array("Last Visit","Another Word Goes here"); //you can add as much as possible
    //note translitejs will not overwrite so define at once
    $lang("en_1",new Array("translation here","translation here also");
    $translite.id = "punbb" //punbb is general class you can change it to "section" to affect section i.e footer header body or use Jquery to add class and set id to class
    $translite.tolang("en_1"); //translate content
    </script>

in footer or header ...not working

is there any code I need to change inside the file: http://forumfiles.wap.sh/files/translit … anslite.js ?

or Please give me the All codes (I need to put in the footer) based on :
Example if I want to translate the sentences: Active Topics and In Foundation or Last Visit

Last edited by kami (2018-02-04 12:27:07)

0

10

I think the problem is language format add your language format to the script
check for

function islang($l,$ol) {
arr = new Array("en","fr","en_1","fr_1","ru","in","yor","pt","sp","custom")

or simply use custom as language format then use en_1 as the to language
then when calling tolang() indicate custom eg

$translite.tolang("en_1","custom");

0

11

jonath45
What`s wrong with this..?

In the footer:

Code:
<script src="http://forumfiles.wap.sh/files/translitejs/v.1.0/translite.js"></script>

<script>
$lang("fr",new Array("Last Visit","my translation"); //you can add as much as possible
//note translitejs will not overwrite so define at once
$lang("fr",new Array("Active Topics","my translation");
$translite.id = "punbb" //punbb is general class you can change it to "section" to affect section i.e footer header body or use Jquery to add class and set id to class
$translite.tolang("fr"); //translate content
</script>


Give me the correct code for: Last Visit, Active Topics,,,,
Not Work

0

12

Oh try this it works for me http://wcoders.cf/pages/translitejs

Super Code wrote:

words = new Array();
words[0] = new Array("Last Visit","Active Topics","Online","last visit","active topics","online");//all the words both upper and lower case in English
words[1] = new Array("Dernier Visite","Les Sujets Actif","A Presente","dernier visite","les sujets actif","a presente");//all the words both upper and lower case in french
$lang("fr",words[1]);
$lang("en",words[0]);
$translite.id="main";
$translite.tolang("fr","en");

0

13

jonath45
Tried this still not working

Code:
<script src="http://forumfiles.wap.sh/files/translitejs/v.1.0/translite.js"></script>

<script>
words = new Array();
words[0] = new Array("Last Visit","Active Topics", "Welcome");//all the words both upper and lower case in English
words[1] = new Array("my translation","my translation", "my translation");//all the words both upper and lower case in french
$lang("fr",words[1]);
$lang("en",words[0]);
$translite.id="main";
$translite.tolang("fr","en");
</script>

Last edited by kami (2018-02-12 11:01:51)

0

14

@kami you didnt add lowercase.
translite is case sensitive and in  cases wherein the word is transformed with css translite will not translate

0

15

jonath45 wrote:

@kami you didnt add lowercase.
translite is case sensitive and in  cases wherein the word is transformed with css translite will not translate

STILL NOT WORK (where it is wrong)

Code:
<script src="http://forumfiles.wap.sh/files/translitejs/v.1.0/translite.js"></script>

<script>
words = new Array();
words[0] = new Array("Last visit","Active Topics","Welcome");//all the words both upper and lower case in English
words[1] = new Array("My translation","My Translate","Translate");//all the words both upper and lower case in french
$lang("fr",words[1]);
$lang("en",words[0]);
$translite.id="main";
$translite.tolang("en","fr");
</script>

Last edited by kami (2018-02-13 09:01:29)

0

16

@kami ill explain better what i mean

Take a look at this source code of http://forum.mybb.us home page

PUN-STATUS wrote:

<div id="pun-status" class="section">
<h2><span> User info </span></h2>
<p class="container">
<span class="item1"> Welcome,
<strong>jonath45</strong> .</span>
<span class="item2"> Last visit:
<strong>Today 00:50:38 </strong>.</span>


to translite you still haven't entered the text so you ought add all possible combination of upper and lowercase i.e

words[0] = new Array("Last visit","Last Visit","last visit","last Visit","LAST VISIT"); //do the same for multi translation or just add Last visit if it only single translation


I hope i could help

0

17

jonath45

Example
from en to fr
en: Last Visit
fr: my translation

Please just copy and paste ALL of the correct codes here for the translation of (Last visit,Active Topics,Welcome)  (so i can use)

0

18

Super Code wrote:

words = new Array();
words[0] = new Array("Last","Visit","Active Topics","Welcome","last","visit","active topics","welcome");//all the words both upper and lower case in English
words[1] = new Array("Dernier","Visite","Les Sujets Actif","Bienvenue","dernier","visite","les sujets actif", "bienvenue");//all the words both upper and lower case in french
$lang("fr",words[1]);
$lang("en",words[0]);
$translite.id="main";
$translite.tolang("fr","en");

This should do

if you visit http://wcoders.cf/search.php?action=show_recent from now till tomorrow it will show a translated version I'm still working on

Last edited by jonath45 (2018-02-16 06:38:36)

0

19

jonath45
I just copy Your Super Code, and paste in the footer, but it does not work

Code:
<script src="http://forumfiles.wap.sh/files/translitejs/v.1.0/translite.js"></script>

<script>
words = new Array();
words[0] = new Array("Last","Visit","Active Topics","Welcome","last","visit","active topics","welcome");//all the words both upper and lower case in English
words[1] = new Array("Dernier","Visite","Les Sujets Actif","Bienvenue","dernier","visite","les sujets actif", "bienvenue");//all the words both upper and lower case in french
$lang("fr",words[1]);
$lang("en",words[0]);
$translite.id="main";
$translite.tolang("fr","en");
</script>

Whats Wrong ?

Welcome and Last Visit are not successfully translated
it may also be difficult to translate very long text ?

Example 1: My Upload

Translate this

You can view and delete the files you have uploaded to the forum. Files are stored forever on the condition that they will be reviewed at least once every six months.

Example2: Registration

Translate this

Registration will grant you access to a number of features and capabilities otherwise unavailable. These functions include the ability to edit and delete posts, design your own signature that accompanies your posts and much more. If you have any questions regarding this forum you should ask an administrator

I can translate easily the long sentences using UniverChange and can be used to translate up to 80% of en mybbforum
Help us translate forums!

Last edited by kami (2018-02-18 22:59:00)

0

20

This is quite odd since it works for wcoders.cf well

first check the active topics page and see if the Active topics was translated
Next add a class to body then
change the translite id to the class

Eg

$("body").addClass("myClass");
$translite.id = "myClass";


Dont worry im working on a new version which will have auto translate

0

21

jonath45
I've tried and successfully used your script to translate (Active Topics, by, Topic, Forum, Replies, Last post, Post reply, Quick post),,,, Except: Welcome and Last Visit ... and a few long sentences

I am very stupid about the codes, could u give me all coded that I can copy and paste directly to the footer...
$("body").addClass("myClass");
$translite.id = "myClass";

0

Related topics


You are here » Community Forum » New Forum Features » WCF's translitejs for websites