3

I need to translate the American English Drupal core currently provides out of the box to a variation of English. I know I can use string overrides but there are too many that I need to override. Essentially I need to create my own custom language based off english. Suggestions?

  • If you're looking for en-GB (British English), that's already supported by Drupal, and will show up when you "Add a language". – colan Feb 27 '14 at 17:14
  • That's ok. I need to create a custom "English". – Nigel Waters Feb 27 '14 at 17:16
3

You can do this with the Locale module, which is provided by core. Steps are for Drupal 7. This assumes you want to completely replace the built-in English with your own custom version of English (which will still show the strings for the built-in English unless you have translated/edited them).

  1. Enable the locale module.
  2. Go to languages admin (/admin/config/regional/language).
  3. Click edit for the English (built-in) language. Add en as the Path prefix (this will allow you to add your own language without a path prefix.) Save.
  4. Click "Add a language"
  5. Choose "Custom language", set a language code, set both language names to English, leave Path prefix and Language domain blank, and choose Left to right for the Direction.
  6. Go back to the language list (/admin/config/regional/language) and set your new English as the default language. Then uncheck Enabled for the built-in English.
  7. Translate all the strings you want to modify on the translation screen (/admin/config/regional/translate/translate).
| improve this answer | |
2

The Drupal core locale module is all you need to do this. Enable it if required, then navigate to Home » Administration » Configuration » Regional and languageand notice the two tabs "Export" and "Import".

These allow you to export and import .po files with translations from the default (American English) into your default language. .po-fils are text files. The format is very simple and consists of pairs like these (the line starting with "#" is a comment):

#: src/colors.inc:36
msgid "color"
msgstr "colour"

So just export all the strings of your site, then translate those that needs translation, and import.

(You may want to create a custom language code for your custom english, just to be able to toggle between American english and custom english, instead of just overrwriting the American english.)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.