WPML Load Fonts For Each Language (RU,TR,ZH,EL,EN)

Posted in: Newspaper
Post count: 13

Hello, i would like to know what is the best way to load the specified fonts regarding the language i want. For example, Greek will load Open Sans, Russian will load Montserrat, Turkish will load Montserrat, etc.. I’m using this way in my website, but it seems that when i change page , different from the homepage it doesn’t load the fonts i have uploaded to my server and seems to have an error 404. In this image (https://snag.gy/jTSc1q.jpg) is where my style-sheet css is located, in which there are the @font-face rules for each css file. I have the following code in my header section
<head>
<?php if(ICL_LANGUAGE_CODE == ‘en’){ ?>
<link rel=’stylesheet’ href=’wp-content/themes/fonts/stylesheet.css’ type=’text/css’ media=’all’ />
<?php } elseif(ICL_LANGUAGE_CODE == ‘ru’){ ?>
<link rel=’stylesheet’ href=’wp-content/themes/fonts/stylesheet.css’ media=’all’ />
<?php } elseif(ICL_LANGUAGE_CODE == ‘tu’){ ?>
<link rel=’stylesheet’ href=’wp-content/themes/fonts/stylesheet.css’ type=’text/css’ media=’all’ />
<?php } elseif(ICL_LANGUAGE_CODE == ‘el’){ ?>
<link rel=’stylesheet’ href=’wp-content/themes/fonts/stylesheet.css’ type=’text/css’ media=’all’ />
<?php } ?>
</head>
and after that i have some extra css in my theme panel which says for all the td-rows load the fonts, so that i overwrite existing fonts , that maybe are initialized by default.
.td-header-row {font-family:’Montserrat’;}
:lang(el) {font-family:’Comfortaa’;}
:lang(zh-Hant) {font-family:’source-han-sans-traditional’;}
:lang(ru) {font-family:’Montserrat’;}
:lang(tr) {font-family:’Montserrat’;}
:lang(en) {font-family:’Montserrat’;}
Do you have any better suggestion?

Post count: 22421

Hello,

Sorry but we have not tested such a customization in our themes to change fonts based on language. Our theme has only 1 fonts section and not different ones for different languages. You can give wpml a shot and follow this topic: https://wpml.org/forums/topic/change-fonts-by-language

Thanks.

Post count: 13

Finally i found my solution ,but thanks !

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.