Fails to change the language of a WP site - php

I'm building a WP site for a Spanish company, and I want to change the language of the site (not the admin area's language).
All the posts and the things that I put in the site are in Spanish, since I created them, but the default texts of the theme are in English (for instance, the string "search" inside the search box).
When I'm trying to change the language through Settings -> General -> Site language to "Español", it changes. But after I refresh the page it returns to "en_US" again, and in the bottom it says:
Note: The WPLANG constant in your wp-config.php file is no longer needed.
I did change the WPLANG in wp-confing.php to define('WPLANG','es_ES'), doesn't seem to help.

I am not sure if you have put the language files in the right place.
So, first you need to download spanish language files, you can find here
and then put them into /wp-content/langauges folder, if no, create it.
you can find full tutorial here

First, you have to download spanish version.
All files of wordpress system will translate to Spanish, BUT, some words of your current theme installed maybe are in english, you'll translate it.
In search.php you will find the input box, where you will change the word "Search.." this are in Apparence (Apariencia) -> Editor (Editor)

First, make sure the theme you are using is multi-language.
If no:
You need to translate the theme files located in wp-content/themes/
-EDIT:
You need to download the correct theme to your computer and manually edit the files within the theme folder, then upload it again.
Basically just go trough the theme code and replace the english text you see, for example "next post"/"previous post" to the correct sentence in Spanish in your case.
Just make sure to not edit anything you don't understand :)
Give me a shout if you need more help :)

Related

Can we change "#comments" from URL in the Wordpress theme

In my Wordpress site, all the contents of URL in my language, Turkish. When I want to link to a page's comments, I have to write it like this: http://siteadi.com/icerigin-basligi/#comments. I don't mind normally, but I don't want URL, a part of it to be in Turkish and some in English. So I want to change #comments with #yorumlar in the theme.
I know, we can do this with changing get_comments_link() function in the wp-includes/comment-template.php. But I think, this is not a good solution, because if the theme is updated, the edited content will also be deleted. So I want to do this with the theme page. Is it possible or do I have to do it in wp-includes/comment-template.php?
Do never edit core files
(located in /wp-includes, /wp-admin etc.) . Do not do it! (https://wordpress.stackexchange.com/questions/1639/what-are-some-reasons-why-you-should-not-hack-wordpress-core-files).
If you are using a ready-bake theme then you have to create a child theme (https://codex.wordpress.org/Child_Themes), copy the comments.php file from your main theme into it and change id="comments" to id="yorumlar".
<div id="yorumlar" class="comments-area">
This way you can still update your theme without destroying any changes.
If you have developed a theme yourself just change the name of the ID in comments.php to your needs.
Note: In a multilanguage page HTML IDs are usually not translated as this causes problems with CSS, JavaScript and anything else. An HTML ID / anchor is a technical thing which should be language independent while usually english is used as global internet default language (last but not least because of the ASCII charset).

Loco Translate not shows all translations

I am using Loco Translate to translate wordpress and woocommerce. Great plugin, but unfortunately some string translations are not visible/working on the frontend at the checkout page and cart. Could this be a child team problem?
Strings are know in Loco Translate and correctly translated, they are only not showing up at frontend.
Translation String issues:
Have a coupon? Click here to enter your code.
Flat rate:
Subscribe to our newsletter
Site www.narwal.shop/checkout
Help is appreciated.
Go to wp-content and uploads directory. create a new directory and name it as same as the plugin name. then create a new directory and name it languages.
now upload your .po and .mo files in it.
the problem is solved!
Force WP to load the language file from languages/loco/themes/.. directory, like this inside functions.php:
add_action ( 'wp', 'load_translations' );
function load_translations() {
load_theme_textdomain( 'theme-name-here' );
}
Update: you should contact the creator of the (child) theme.
Every single component that displays text (i.e.: almost all of them), including themes and plugins, need to have included multilingual support for it to work.
Woocommerce does it, but you might have other components that do not. If you have a custom theme, that would be the first thing I'd check.
Unfortunately, if this is the case there is nothing you can do about it other than not use it, accept that that part of the site will not be translated or ask the developer who made them to put in the extra work to add multilingual support.
See also: https://localise.biz/wordpress/plugin/child-themes
In my case it was a wordpress language problem. I resolved this by changing it from English to my target translation language. To achive this in your wordpress panel go to: Settings -> General -> find language and change it.

WooCommerce: Localise some text button in storefront theme

I am making Wordpress/WooCommerce webiste, and I am using "Storefront" as theme, but now I have problem because I am not making website in English, so now I want to change buttons text, on example "View Basket", "Checkout" and "Add to Basket".
But I don't know where can I change it in code. Or what I need to do to change it?
You can install Storefront in a language of your choice. You might want to follow this guide https://docs.woothemes.com/document/installing-storefront-in-your-language/
There you will also find the link to create a custom WooCommerce Localization
You will need to decide what fits your needs.
Custom translations can basically be done by putting translation files into
wp-content/languages/themes/
For Storefront name the file
storefront-it_IT.mo
You will find more information on the refered link
Ok what is properly answer here, and most easiest solution: You should download translated files for your language, probably Wordpress community from your country did it already. So zipped files you should unzip and insert into
wp-content/languages/themes and wp-content/languages/plugins. You should have 2 files with .po and .mo extensions. After that simply go in your dashboard->settings->Site language: "Your language".
And that should be it.
https://docs.woothemes.com/document/installing-storefront-in-your-language/

Eliminating WordPress Error "Hello world! Please change me in Site Preferences -> This Category/Section -> Lower Description Bar"

I inherited some unfinished website from another developer on WordPress 4.2.2 running the Wise Guys theme. On other pages, the Lower Description Bar shows great quotes from people, but on a specific page (the gallery page) it shows these words... Hello world! Please change me in Site Preferences -> This Category/Section -> Lower Description Bar. Obviously it looks ugly.
I am not a great WordPress user myself, I prefer Joomla, but my client is needing his site to work right in WordPress.
I've got a few questions in this regard:
1) How do I tell the Category/Section of the specific page so that I can follow that suggested path above? I don't seem to find a reasonable route; after all there's only one category that doesn't seems to feature anywhere on the pages.
2) When I login to the backend and follow that path (Site Preferences -> etc...) there's little to do or change. Where in the file system could I do a manual edit, if need be? I'd still want to keep the quotes showing on the other pages, even on this particular page if possible.
Check which plugins are activated. The quotes sounds like "Hello Dolly" is activated. You can deactivate it, since it is a default plugin included with the WordPress download.
As for manual edits, all of your changes should take place in your theme, keep in mind that any changes to a third party theme will be overwritten with any updates. So, you should rename the theme to a custom name. Themes are locate in the themes folder "/path/to/your/wordpress/wp-content/themes".

How to make a wordpress theme that supports only 1 .po file to support 2

i am trying to make my website support 2 languages that users can switch between them, i bought a theme that has a language directory with .po files such as en_US.po fr_FR.po and more. i copied the english file and translated it into Arabic, in order to apply the Arabic translation i have to rename the ar_EG.po to en_US.po which leaves me with 1 language option and i need to have both Arabic and English. Is there a way that i can make my website switch between 2 .PO files instead of 1 or can i make a new folder inside my word press installation with the same website but with the other language file working and both of the websites linked to the same database?
There are various plugins to manage multilanguage sites; I would personally recommend Polylang since it's free, very easy to use and makes a smart use of WordPress APIs so it's developer friendly, if you would need that. Also, every content gets its own URL, which it's good for SEO.
After installation, go into Settings → Languages to define the languages of your site. The plugin provides a widget that will enable your visitors to change the language of the site, as well as an special nav menu item.
You should keep the theme translation as ar_EG.po; the plugin and language switcher that comes with it will take care of loading the appropiate language file for the theme.
ya elipelavinz is right that plugins name is polylnag
if you want to tranlate your theme caption use codingstyleloalization
codingstylelocalization translate only __() caption or _e() function

Categories