Language structure upgrade guide.

Overview

I have gotten almost all of the site text into the language files with a few exceptions to note

  • tos.tpl
  • privacy.tpl
  • a few text snippets pointing to OAC from within the admin

I have made a rather large file structure change to address some of the short comings of the existing language setup. Hopefully after the initial sting and cursing of me the new structure will be beneficial for easier upgrades and less hassle in the future when new definitions are added to pages and better internationalization support. This should also alleviate some of the pain of upgrading to new versions of OAC when template changes are made.

This will take a lot of time to do it right and I apologize for such a large file structure change. If you have made a lot of custom changes follow the steps below. I hope they are good enough. If you have a basically stock OAC you can just upgrade as normal, overwriting the php files on the server and uploading the en folder to your ./Includes/language/ folder even if you have made a lot of custom language file changes this may be an easier route to take and then edit later. No rotten tomatoes please!

Language file update Instructions

English Language file update((default language))

  • Once you have unzipped the upgrade installation package you should look carefully at the file structure, get a feel for how it is laid out. As you will notice there is a folder located in the ./Includes/language/ folder named en and inside that folder are files named for every PHP file.
  • Find the file global.php inside your en lang folder. Merge global.php with your existing en.php lang file, if you have made custom changes to your lang file overwrite all the changes to the global.php lang file.

!!!NOTE Do not just save the en.php file as global.php as there are a ton of new language defines in the global file. Use a program such as winmerge or diff.

  • Once you have merged your en file with the new global lang file save the new global.php to your language folder ”./Includes/language/en/global.php”
  • Now that you have an enormous language file with all defined variables, start to look through at the different commented sections. You will notice they have comments such as
    //registration page text blah blah

    . Copy these different sections into the pages for each section. once you have that complete your userside upgrade should be well on the way to being finished.

  • At this point if you have not already done so upload the changed php files released in the v1.5.0b upgrade but NOT, the admin folder just yet. I would look through all the pages to see if something has been missed.
  • Now that the userside has been completed I have done the entire admin section also. I hope this will be less hassle as there really wasn't much to speak of in terms of language defines for the admin section but that has changed. If you have made custom admin changes follow the same procedures listed above in steps 1-4 if you have not made any custom changes just overwrite the files in your /admin/ folder and your done.

NON-English Language file update ((alternate language))

Please reference http://www.sil.org/iso639-3/codes.asp International language code tables.

If you are not using an English language file there are different steps to take you may have it somewhat easier. As you may notice there is no folder with your language abbreviation as of v1.5.0b I will no longer support any languages other than English. This is due to just plainly, I cannot read or write any other language so for me to try and keep a language set up to date is almost impossible.

  • Firstly I would make a copy of the entire ./Includes/language/en folder and rename it to that of your abbreviated language code such as for Spanish spa or Russian ru now what you have is a folder with all of the default language definitions.
  • If you have an existing lang file such as the es.php follow the same steps as listed in step 1 above. merge your es.php file with the global.php file located in your newly created directory.
  • Find the file global.php inside your new lang folder. Merge global.php with your existing lang file, if you have made custom changes to your lang file overwrite all the changes to the global.php lang file.

!!!NOTE Do not just save the file as global.php as there are a ton of new language defines in the global file. Use a program such as winmerge or diff.

  • Once you have merged your file with the new global lang file save the new global.php to your language folder ”./Includes/language/YOUR_LANGUAGE_ABBREVIATION/global.php”
  • Now that you have an enormous language file with all defined variables, start to look through at the different commented sections. You will notice they have comments such as
    //registration page text blah blah

    . Copy these different sections into the pages for each section. once you have that complete your userside upgrade should be well on the way to being finished.

  • At this point if you have not already done so upload the changed php files released in the v1.5.0b upgrade but NOT, the admin folder just yet. I would look through all the pages to see if something has been missed.
  • Now that the userside has been completed I have done the entire admin section also. I hope this will be less hassle as there really wasn't much to speak of in terms of language defines for the admin section but that has changed. If you have made custom admin changes follow the same procedures listed above in steps 1-3 if you have not made any custom changes just overwrite the files in your /admin/ folder and your done.
  • A default behavior of the alternate language sets is if a lang file is not present it will default back to the en language file. So if you have an es lang folder located in the admin language and there is no lang file for admin.php it will pull the defines from the default language folder which is /admin/Includes/language/en/.
 
Structure/Language_upgrade.txt · Last modified: 2008/12/27 23:32 (external edit)
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki