Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multilanguage support
#14
Here is the answer from opengoo team:

Opengoo team Wrote:You can download the latest OpenGoo and check file 'application/controllers/ToolController.class.php'. In that file there's a function called 'translate'. That function is the one invoked to build the translation tool. This function just loads all the necessary info and then sends this info to another file that is in charge of printing the web page. This other file is 'application/views/tool/translate.php'. This was done like this because OpenGoo uses the MVC pattern. You could copy all of the code (the function and the view) and put it in one file with some modifications to achive the same behavior. Some things you should consider:

1) The 'translate' function calls other functions in the ToolController which you would have to copy too, and maybe it uses functions defined on other places in OpenGoo. You coulduse a good IDE to be able to find all this functions quickly (like Ctrl+click on the function name to go to the function). One good IDE is Eclipse PDT.

2) This tool was made for OpenGoo's language files format. It would have to be changed if the file format you use for translations is different. OpenGoo's file format is a PHP array (key => value) in the case of PHP files, and a Javascript object (key : value) passed to a function called 'addLangs' in the case of javascript files. You can check these formats in the language folder.

3) The function 'translate' passes all the info to the 'translate.php' view by using function 'tpl_assign'. What this function does is that it creates variables named like the first parameter, containing the value given as the second parameter. These variables are directly accessible in 'translate.php'. If you wanted to join all of the code as I mentioned earlier, instead of doing tpl_assign('name', $value) you could just do $name = $value; to achieve the same effect.

Hope it's not too confusing. If you have any questions you can ask me.

Regards.
Reply


Messages In This Thread
Multilanguage support - by someone - 2009-08-08, 10:38:02
RE: Multilanguage support - by alexela - 2013-08-17, 07:06:10
RE: Multilanguage support - by elpak - 2021-05-01, 20:45:57
Multilanguage support - by kristjanmik - 2009-08-08, 10:42:02
Multilanguage support - by someone - 2009-08-08, 10:44:33
Multilanguage support - by kristjanmik - 2009-08-08, 10:48:26
Multilanguage support - by ccagle8 - 2009-08-08, 11:29:35
Multilanguage support - by kristjanmik - 2009-08-08, 11:48:54
Multilanguage support - by ccagle8 - 2009-08-08, 11:55:26
Multilanguage support - by kristjanmik - 2009-08-08, 12:05:35
Multilanguage support - by ccagle8 - 2009-08-08, 12:08:33
Multilanguage support - by kristjanmik - 2009-08-08, 12:11:25
Multilanguage support - by someone - 2009-08-08, 16:35:15
Multilanguage support - by kristjanmik - 2009-08-08, 21:26:29
Multilanguage support - by eddyfever - 2009-08-08, 22:33:02
Multilanguage support - by kristjanmik - 2009-08-09, 00:31:01
Multilanguage support - by Derek - 2009-08-09, 01:35:27
Multilanguage support - by kristjanmik - 2009-08-09, 01:47:03
Multilanguage support - by Derek - 2009-08-09, 03:43:48
Multilanguage support - by wizzy - 2009-08-16, 04:05:03
Multilanguage support - by ccagle8 - 2009-08-16, 04:07:22
Multilanguage support - by someone - 2009-08-18, 02:40:53
Multilanguage support - by icebird - 2009-08-19, 06:02:23
Multilanguage support - by tomcat - 2009-08-21, 19:10:26
Multilanguage support - by ccagle8 - 2009-08-22, 03:21:49
Multilanguage support - by someone - 2009-08-22, 04:25:12
Multilanguage support - by ccagle8 - 2009-08-22, 05:56:33
Multilanguage support - by n00dles101 - 2009-08-22, 06:06:38
Multilanguage support - by ccagle8 - 2009-08-23, 11:25:15
Multilanguage support - by ccagle8 - 2009-08-26, 12:42:16
Multilanguage support - by someone - 2009-08-26, 20:03:27
Multilanguage support - by cokeramirez - 2009-08-27, 03:39:44
Multilanguage support - by Brian - 2009-08-27, 04:12:11
Multilanguage support - by ccagle8 - 2009-08-27, 12:22:07
Multilanguage support - by cokeramirez - 2009-08-27, 12:34:42
Multilanguage support - by cokeramirez - 2009-08-27, 12:45:11
Multilanguage support - by ccagle8 - 2009-08-27, 12:56:09
Multilanguage support - by cokeramirez - 2009-08-27, 14:53:09
Multilanguage support - by Brian - 2009-08-28, 02:49:09
Multilanguage support - by Brian - 2009-08-28, 03:17:49
Multilanguage support - by ccagle8 - 2009-08-28, 04:08:57
Multilanguage support - by ccagle8 - 2009-08-28, 12:46:41
Multilanguage support - by badcat - 2009-08-28, 13:00:57
Multilanguage support - by cokeramirez - 2009-08-28, 15:04:40
Multilanguage support - by Brian - 2009-08-28, 15:16:35
Multilanguage support - by badcat - 2009-08-28, 15:28:17
Multilanguage support - by Hakan - 2009-08-28, 18:53:27
Multilanguage support - by ccagle8 - 2009-08-28, 23:47:56
Multilanguage support - by Brian - 2009-08-29, 04:16:30
Multilanguage support - by ccagle8 - 2009-08-29, 04:36:01
Multilanguage support - by n00dles101 - 2009-08-29, 05:20:44
Multilanguage support - by Pat64 - 2009-08-29, 05:40:18
Multilanguage support - by ccagle8 - 2009-08-29, 06:21:54
Multilanguage support - by Pat64 - 2009-08-29, 08:27:10
Multilanguage support - by Brian - 2009-08-29, 14:32:49
Multilanguage support - by Pat64 - 2009-08-29, 17:41:38
Multilanguage support - by kotos - 2009-08-30, 05:48:18
Multilanguage support - by ccagle8 - 2009-08-30, 09:24:18
Multilanguage support - by ccagle8 - 2009-08-30, 11:49:09
Multilanguage support - by Pat64 - 2009-08-30, 17:29:56
Multilanguage support - by Pat64 - 2009-08-30, 19:20:29
Multilanguage support - by ccagle8 - 2009-08-31, 01:52:57
Multilanguage support - by Pat64 - 2009-08-31, 19:13:15
Multilanguage support - by Zegnåt - 2009-09-01, 03:26:14
Multilanguage support - by Brian - 2009-09-01, 06:21:47
Multilanguage support - by ccagle8 - 2009-09-01, 08:10:47
Multilanguage support - by Pat64 - 2009-09-01, 18:21:14
Multilanguage support - by Hakan - 2009-09-01, 19:54:50
Multilanguage support - by ccagle8 - 2009-09-01, 20:28:49
Multilanguage support - by Pat64 - 2009-09-01, 20:35:16
Multilanguage support - by Brian - 2009-09-01, 22:02:39
Multilanguage support - by Pat64 - 2009-09-01, 22:28:42
Multilanguage support - by ccagle8 - 2009-09-02, 08:28:45
Multilanguage support - by kotos - 2009-09-02, 18:35:08
Multilanguage support - by ccagle8 - 2009-09-03, 19:27:15
Multilanguage support - by panathos - 2009-09-04, 13:54:34
Multilanguage support - by wizzy - 2009-09-04, 23:58:20
Multilanguage support - by ccagle8 - 2009-09-05, 12:51:49
Multilanguage support - by vsky - 2009-09-06, 01:03:35
Multilanguage support - by marty80 - 2009-09-07, 01:20:22
Multilanguage support - by someone - 2009-09-07, 01:36:37
Multilanguage support - by ccagle8 - 2009-09-07, 08:17:09
Multilanguage support - by ccagle8 - 2009-09-07, 11:14:21
Multilanguage support - by Hakan - 2009-09-08, 01:10:26
Multilanguage support - by ccagle8 - 2009-09-08, 01:24:00
Multilanguage support - by Hakan - 2009-09-08, 01:54:51
Multilanguage support - by guhemama - 2009-09-08, 09:45:15
Multilanguage support - by ccagle8 - 2009-09-08, 12:04:51
Multilanguage support - by lantonioli - 2009-09-09, 17:37:48
Multilanguage support - by ccagle8 - 2009-09-09, 20:02:40
Multilanguage support - by guhemama - 2009-09-09, 23:52:37
Multilanguage support - by marty80 - 2009-09-10, 03:07:16
Multilanguage support - by guhemama - 2009-09-13, 04:23:39
Multilanguage support - by Patricia - 2009-09-17, 07:12:22
Multilanguage support - by lona79 - 2009-09-17, 22:57:24
Multilanguage support - by someone - 2009-09-25, 04:30:18
Multilanguage support - by ccagle8 - 2009-09-25, 10:23:59
Multilanguage support - by shuvro - 2009-10-12, 17:25:08
Multilanguage support - by ccagle8 - 2009-10-13, 02:31:34
Multilanguage support - by wizzy - 2009-10-13, 03:28:34
Multilanguage support - by Zegnåt - 2009-10-31, 23:45:50
Multilanguage support - by manolisf - 2009-11-14, 06:41:32
Multilanguage support - by packe - 2010-07-17, 08:08:53
Multilanguage support - by packe - 2010-07-17, 08:41:32
Multilanguage support - by marty80 - 2010-07-17, 09:00:59
Multilanguage support - by Oleg06 - 2010-07-17, 17:06:30
Multilanguage support - by vsky - 2010-08-16, 20:23:40
Multilanguage support - by mouffin - 2010-08-24, 09:14:49
Multilanguage support - by madvic - 2010-08-25, 00:42:33
Multilanguage support - by oggin - 2010-08-26, 09:06:31
Multilanguage support - by mitakadan - 2010-09-02, 22:57:14
Multilanguage support - by bogyvet - 2011-05-22, 07:55:47



Users browsing this thread: 1 Guest(s)