Welcome Guest, Not a member yet? Register   Sign In
Add Language from inside the CI
#1

[eluser]Unknown[/eluser]
Hello,
I am developing web application using CI and i was wondering if there is a way to add a language to CI from it's own application instead of creating a lang dir and uploading via FTP.

What i am trying to achieve and check if possible is this scenario:

1) Customer decided to add German language to his website
2) Customer login to his admin panel
3) Click on create language , inputs new Language name and in return gets a page with english translation SKELETON that he needs to translate to Germany, once he saves it it should create a dir germany inside CI langs.

Is it doable ? how ?

Thanks in advance,
Dima.
#2

[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter forums!

I don't understand how your app works.

Does every customer have the same page? If so, why don't you translate the page into as many languages as you can. There are lots of people around who will translate for a price, or you can add languages as they're requested. If someone wants German, and they're able to translate it, you can add it (after checking it, of course). I don't see the point of more than one person translating the same text.

If a user can edit their own page, then I would have thought they could take care of the languages for themselves.
#3

[eluser]hyperfire[/eluser]
Yes, it is doable.

First things first. If a user have already translated his website to German, other users who want to translate to German will have to use this user translation or everyone can have their own?

If users share the languages, this new language will need to have moderation (so you can validate the translation, before other users can use it. This may be stored in a table with an active flag or something).

If users don't share the translation, all you need to do is to have a language table with the default values on record 1 (to act as model) then every user just writes their own line on this table with a common insert (that you can read based on user ID, you have a users table right?)

To write into the CI language dir, that dir needs write permission so you can create the folder and the files.
Those files will need to share a common structure (the template library comes to mind) and there you go.




Theme © iAndrew 2016 - Forum software by © MyBB