Then switch to the Current Menu tab and set Hide Label to Yes. Open it, uncheck the pre-selected option Dashicons (we don’t need it) and check the Images option like in the image to the left. When you are in Menus section, you’ll see a new element in Add menu items left side bar: Menu Icon Settings. If Menu plugin just do this: it allows to add a conditional logic so you can show or hide single menu items depending on the user’s role. Technically, the If Menu plugin is not strictly necessary: I use it because I don’t want visitors can change the website text as they want and I suppose that the majority of you will do the same. This function works out of the box with Transposh widget but since we’re not using it we’ll have to implement it manually. Now we have to add another menu item to switch on or off the option to edit the translation if we are not to happy with it. The plugin allows to choose if the menu item text must be visible or hidden, so we can add to our menu the 2 flags quickly and easily. This small adorable plugin ( ) allows you yo set any icon or image you want to associate it to a menu item. In order to use our flags we’re going to use a couple of useful plugins (even these ones are totally free). In thus article I’ll use three flags, english, spanish (because I live in Spain) and italian (because I’m from Italy), but obviously feel free to use the flags you really need to use. Just google a bit and you’ll find a lot of free flag icons sets: choose your favorite one download it and upload the flags to your website using the Media section of WordPress dashboard. Then, go o Appearance->Menus, open Screen options clicking on the top-right tab and check the CSS Classes checkbox as shown in the image below.įirst we need to get our flag icons. we’ll upload to our WordPress installation the flags’ images we needįirst, as I said before, go to Settings-> and set it to Post name (%postname%).So, summarizing, first we have to provide our user an easy and possibly beautiful way to switch between languages secondly, we have to provide to administrators and editors a quick way to put the website in edit mode to fix translations’ errors. Depending on Transposh settings (leave them to default if you don’t have any specific issue with this), every text in the page will have a small yellow button appended: clicking on that button will show a popup to edit the translation or just approve them (approved translations will have a green button instead of a yellow one) As you can see, a checkbox appears immediately under the flags: checking it will reloads the page in Edit mode. When you click on the flag of a non-default language, Transposh reloads the page and changes its own aspect. So, what to do? Well, we’re going to build our custom language switcher. ![]() And last but not least, English language is represented by the United States flag! Don’t know why, after all english is english and it was born in UK. Once Transposh has been updated to the full version, you finally get the widget and… As usually, it happens that the widget probably doesn’t integrate in your website design, requiring a lot of work to add custom CSS, trying to style it in a coherent way with the rest of your styles. After some time you’ll be notified there is an update available for Transposh: update and you are ok. Go to Transposh section of the dashboard and choose Settings, then check the “Allow upgrading to full version from, which has no limit on languages used and includes a full set of widgets” checkbox and click Save changes button. In addition, Transposh let you fix any translation error in a quick and easy way! So I’ll show you How to use a custom language switcher with Transposh to build a multi-language website with WordPress.īut… Always there is a “but” First, to use the full widget you must upgrade to fully version: no problem, is free. Your text will be automatically translated in the selected language
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |