|
Language support
|
|
12-17-2008, 05:16 AM
Post: #11
|
|||
|
|||
|
RE: Language support
I did the translation system with the replacements in the output.
I used str_replace() and not ereg_replace() because ereg_replace can't handle HTML and this has to be because otherwise the error like I said in post 5 happens. I have not coded a system to choose language in THT, that still has to happen. This is what I already have: includes/output.php PHP Code: <?includes/language.php PHP Code: <?It's quite simple, but the translation is the most work! (I'll translate it into Dutch) |
|||
|
12-17-2008, 12:50 PM
Post: #12
|
|||
|
|||
|
RE: Language support
Very nicely done, exactly how I meant.
I would use a different data structure though. Use: PHP Code: $variables[0] = array("Client Area", "El Cliento Areo"); You catch my drift
Jonny H - THT Main Developer & Founder |
|||
|
12-17-2008, 04:27 PM
Post: #13
|
|||
|
|||
|
RE: Language support
My system is easier if you want to use different languages. Else the files will have to have each time the english forms and it's better to keep it compact. I don't know how I'll manage the language selection, but maybe you could help?
Now I have translated the Order and now I have to do Admin and Client control panel (don't know sure that i'll do the admin cp) |
|||
|
12-17-2008, 05:17 PM
Post: #14
|
|||
|
|||
|
RE: Language support
Oh yeah, sorry didn't think that through.
Simple, I'd have a folder in includes call languages, with php files like, dutch.php that the includes/languages.php includes, depending on the scripts setting. Jonny H - THT Main Developer & Founder |
|||
|
12-18-2008, 04:48 AM
Post: #15
|
|||
|
|||
|
RE: Language support
Yes, with a language setting in the database that loads the good language file. (wasn't there a function included in THT for checking all files in a folder?)
|
|||
|
12-18-2008, 08:23 AM
(This post was last modified: 12-18-2008 08:24 AM by Jimmie.)
Post: #16
|
|||
|
|||
|
RE: Language support
How about this, language files be stored in a different folder /languages, and like this:
/languages/english/lang_orderform.php /languages/english/lang_admin_home.php (Admin area home) etc... Btw, if anyone wants me to translate to Portuguese, drop me a PM. Will do that. Jimmie Lin - Community Manager & THT.Next Developer |
|||
|
12-18-2008, 09:15 AM
Post: #17
|
|||
|
|||
RE: Language support
(12-18-2008 04:48 AM)alfaleader Wrote: Yes, with a language setting in the database that loads the good language file. (wasn't there a function included in THT for checking all files in a folder?)Yeah there is. The function is: PHP Code: $main->folderFiles("folderlink"); PHP Code: $main->folderFiles(LINK ."languages/"); PHP Code: $files = $main->folderFiles(LINK ."languages/");Jonny H - THT Main Developer & Founder |
|||
|
12-18-2008, 01:12 PM
Post: #18
|
|||
|
|||
|
RE: Language support
Ok, thanks!
|
|||
|
12-22-2008, 12:34 PM
Post: #19
|
|||
|
|||
|
RE: Language support
I need help:
PHP Code: <?I have made in the database unther tht-config, name = 'language' , the 'value' should be the language I want. The problem is that I can't get this value out of the database. Could someone do this for me? (i get 'Resource id #62' if I try )
|
|||
|
12-22-2008, 01:27 PM
(This post was last modified: 12-22-2008 01:28 PM by Jimmie.)
Post: #20
|
|||
|
|||
|
RE: Language support
Easy.
$db->config('language');. No need to query. This pulls up the value 'language' from the tht_config table. With your code, it would be: PHP Code: public function __construct() { # Assign stuff to variables on creationJimmie Lin - Community Manager & THT.Next Developer |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)





)