Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 -

Supporter timezone: Europe/Zagreb (GMT+02:00)

This topic contains 3 replies, has 2 voices.

Last updated by Dražen 1 year, 6 months ago.

Assisted by: Dražen.

Author Posts
October 15, 2023 at 6:22 am #14578575

idrisA

Tell us what you are trying to do?

1) I tried to use a custom language file for English and Arabic by creating files inside child theme language folder. But it is not fetching the language file. The text domain is 'divichild' and file name is 'divichild-ar.po'. Attaching the screenshot also.

2) Is it possible to add translation in .po file without file line number.

3) I have exported the .po file from string translation option in WPML and added some text, but it is not reflecting in frontend.

Is there any documentation that you are following?

Is there a similar example that we can see?

function divichild_theme_setup() {
load_child_theme_textdomain( 'divichild', get_stylesheet_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'divichild_theme_setup' );

What is the link to your site?
The site is accessible only within our network.

string-translation.PNG
language-file-path.PNG
divi-custom-languages.PNG
October 17, 2023 at 6:46 am #14590093

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

thanks for contacting us.

For the first and second points, you can easily test and make sure it works without WPML (disable WPML and switch the default language of WP to Arabic) and then test, if it works fine you can enable WPML and it should work fine also.

As for questions related to WPML:

1) I assume you are using some custom theme for this, so the best would be first to confirm the translation works fine when strings are translated via WPML String translation.

Make sure you are following the next related docs:

- https://wpml.org/documentation/support/enabling-text-translation-for-themes-not-compatible-with-wpml/
- https://wpml.org/documentation/support/translating-the-theme-you-created/

2) Update WPML plugins to the latest versions. To confirm some of the custom code is not causing the issue, switch to the Divi parent theme and add some example code, scan and translate via WPML string translation, and check if it works like that.

Let me know how it goes.

Thanks,
Drazen

October 29, 2023 at 3:27 pm #14686901

idrisA

We have QA and Pre-prod environments, I have updated all the translations via string translation option in WPML. I have exported the translations as .po file and imported into Pre-prod environment but it is not importing anything from the file and I'm not getting any errors. Please find the attached screenshots Please support.

string-translation-qa.PNG
October 30, 2023 at 7:23 am #14688485

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

difficult for me to say what happens or go wrong, make sure to select to include translations in the website where you are exporting them.

If would be helpful if you could please share a video of the process, so I can see what string you are exporting, then importing, and what string does not get translation imported.

Thanks,
Drazen

The topic ‘[Closed] Custom language file’ is closed to new replies.