THT Community
Language support - Printable Version

+- THT Community (https://thehostingtool.com/forum)
+-- Forum: THT Resource Center (https://thehostingtool.com/forum/forum-13.html)
+--- Forum: Plugin Center (https://thehostingtool.com/forum/forum-15.html)
+---- Forum: In Progress (https://thehostingtool.com/forum/forum-17.html)
+---- Thread: Language support (/thread-61.html)

Pages: 1 2 3


Language support - alfaleader - 12-13-2008

I'm now creating a multiple language support for THT.

How it works:
-The compile.php file (this file gets always loaded) loads english.php.inc
-english.php.inc contains the language array
-if THT needs text, it gets the text out of the language array
PHP Code:
<?
$lang = array(
#-----------------------------#
#         ORDER FORM          #
#-----------------------------#
#-----------------------------#
# order/index.php             #
#-----------------------------#
 'order_name' => "Order Form",
 'order_sub' => "Account Creation",
 'order_info' => "IP Logged: ",
 'order_error_ipexists' => "IP Already Exists!",
 'order_error_ipexists2' => "Your IP already exists in the database!",
 'order_error_nopackages' => "No packages",
 'order_error_nopackages2' => "Sorry there are no packages on this server!",
  ) ;
 ?>



RE: Language support - Kevin - 12-13-2008

Cool! And maybe a language class to go with it? Like:
PHP Code:
<?php
$lang
->set("English");
echo 
$lang->string("order_name");
?>



RE: Language support - alfaleader - 12-14-2008

Ok, good idea!


RE: Language support - Jonny - 12-14-2008

Alfaleader, I still go with my idea, it's the best due to new versions and basically all files being replaced. You should go in the output file and use the preg_replace function with all the HTML searching for words and then replacing them with their foreign counterparts.


RE: Language support - alfaleader - 12-14-2008

Doesn't that slows the server to much? But OK, I'll try to do this. And don't it gives problems?

if 'hello test test' must be replaces, but for this 'test' gets replaced to 'blabla', then will 'hello test test' become 'hello blabla blabla' and it won't get replaced.


RE: Language support - Kevin - 12-14-2008

(12-14-2008, 06:12 AM)Jonny Wrote: Alfaleader, I still go with my idea, it's the best due to new versions and basically all files being replaced. You should go in the output file and use the preg_replace function with all the HTML searching for words and then replacing them with their foreign counterparts.

Some languages have different sentence structures. So that wouldn't work. MyBB pulls of multiple language support quite nicely. It wouldn't be a bad idea to model that system.


RE: Language support - Jonny - 12-14-2008

I don't think you grasp, like the language class, it does the same, searches for that sentence eg: "Page doesn't exist" then replaces it with it's counterpart. It would work for all versions, with tweaks. I won't be changing output.php soon. Minus the next version anyway.


RE: Language support - Kevin - 12-14-2008

Ah. I see. I though you meant having it done word-by-word. Sorry, Jonny. Tongue


RE: Language support - alfaleader - 12-15-2008

Ok, i'll try to do this.


RE: Language support - Jimmie - 12-15-2008

Well, how about that be implemented near v2.0? :p I'm talking too far anyway? :p