3

So, I am in the process of adding a second content language to my joomla site and I'm running into an issue. I have successfully added my second language (German) and have rebuilt my site with the second language content and have happily implemented the language switcher. The issue I have is that not all the strings that should have translations are translated.

contact page screenshot

In the image, you will notice that the form components and text are correctly translated, but the strings for "Address," "Phones," and "Miscellaneous Information" are not translated.

The site is updated to Joomla 3.6, and I am using the core contact component.

I have checked the German Language pack, and I can confirm that correct translations exist for each string I want translated, but these translations are inconsistently applied on the Contact Page.

I cannot apply Language Overrides for these strings, because the translations already exist, and if I were to target the English language strings the translations for the whole site would be in correct.

I am using Theme 1498 by Template Monster, and there is only a single language (English GB) pack in the template language folder. I have identified that I want to change the string values for TPL_CONTACT_ADDRESS, TPL_CONTACT_PHONES, and TPL_CONTACT_MISC in the [template]/html/com_contact/contact/default_address.php file.

These strings are all included in the language pack inside of the template. From a very helpful response to an earlier question of mine the strings must be overridden by the template because correct translations exist within the installed language pack.

So, my question is how either remove the hard-coded English strings so that normal translations work, or how to apply my own correct translations for those strings when the correct language is loaded. I have found one or two tutorials on how to do this, but they seem somewhat contradictory or applied to more specific use cases.

2 Answers 2

3

There are a couple of ways to deal with this.

1. Create a German language ini file for your template.

a. Go to languages folder -> EN-GB

b. Spot your template's EN-GB language file: e.g. en-GB.tpl_theme1498.ini

c. Copy it into the de-DE language folder.

d. Rename it to de-DE.tpl_theme1498.ini (or whatever is the theme1498 naming).

e. Edit it and replace the English Translations with your desired ones.
For example:
- TPL_CONTACT_MISC="Miscellaneous Info" change to:
- TPL_CONTACT_MISC="Your german misc info translation"


2. Create language overrides for the translatable Language Strings of your template.

a. In the backend - go to Extensions->Languages->Overrides

b. Use the filter on the left to filter for GERMAN DE - SITE, overrides.

c. Have the contacts template override file open and look for any Language Constants. Copy each one and then click the New Button on the Overrides page to create a new override.

d. Paste the Language Constant and type your desired translation in the corresponding fields. Save.

Create new language override


3. Override the override: Add your own Language strings - or those from the com_contact.

I bet this template hardly will get any update. Me personally I could even go with this option of replacing the template's language strings with the default ones from the com_contact component.

1
  • Took me longer than it should have but I think I got there the same way. Your prev answer helped get me there
    – nizz0k
    Commented Jan 26, 2017 at 14:31
2

So, in my case it was that the strings were hard-coded into the template through the inclusion of a single language pack in the template language folder for English. What I did was to create my own language file by copying and relabeling the folder and files (e.g. from en-GB -> de-DE) and updating the values for the strings I wanted. The critical factor was updating the templateDetails.xml file in the root of the template folder to include pointers to the new language folder and files in the language tag. here again, I copied the lines of code and updated them to point to the correct files and folders. This tutorial was helpful for reference, but applies to a different use case so the instructions will not directly correspond. I was finally tipped off thanks to responses to a previous question of mine and the answer and response to this question here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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