Frontend strings translation
-
Hello,
I am making a multilingual website. I have done pretty much all the translation.
See my page: Chinese English
Only I really could not find a way to translate the grey “tabs text”(in the property page) like the Description, Amenities etc.
Also all the Listing Taxonomies name – like those I have on the search widget on the right. I cant even find those strings?I’ve spent quite a long time on this already, but still don’t seem find a solution.
Can you help me please.
Thanks a lot!
-
Hello
You fill these strings in your theme options? They are displayed in “Setting” > “Languages”: tab “Strings translation”?
Could you check if the theme author has included a wpml-config.xml file in your theme?Hello Chrysti
Thanks for the respond!
No it’s not from the theme, it’s part of the plugin(wp-listings).
I also went to the “Strings translation” but I couldn’t find any string tag from the plugin(wp-listings), maybe because those tabs are not from the theme.I went to my theme and also the plugin folder, both don’t have that wpml-config.xml file. But I do know its something about the custom field, isn’t it?
If I don’t have one, should I make one?I actually went to the plugin(wp-listings) language folder and tried to translate from the pot. file they provided. All It has there were the backend texts , nothing from the frontend? Do you know why?
Thank you!
Could you provide a copy screen of setting where you fill the strings:
– “Location”,”Length of stay”…
– and another one of “Description”, “Amenities” …Hi Chrysti
Thanks for the reply again!
Here is where i fill those strings
All Taxonomies
Description and Amenities stuffCheers!
Also for the Taxonomies,
Please see this image hereThere is no option for me to translate the Taxonomies ids, couldn’t figure out why. is there any way to translate those?
Cheers!
Here is the code i use for the tabs. If it matters.
<div id="listing-tabs" class="listing-data"> <ul> <li><a href="#listing-description">Description</a></li> <li><a href="#listing-my-sum">Amenities</a></li> <?php if (get_post_meta( $post->ID, '_listing_apartment', true) != '') { ?> <li><a href="#listing-apartment">Apartments</a></li> <?php } ?> <?php if (get_post_meta( $post->ID, '_listing_gallery', true) != '') { ?> <li><a href="#listing-gallery">Photos</a></li> <?php } ?> <?php if (get_post_meta( $post->ID, '_listing_local_amenities', true) != '') { ?> <li><a href="#listing-local-amenities">Local amenities</a></li> <?php } ?> <?php if (get_post_meta( $post->ID, '_listing_enquire', true) != '') { ?> <li><a href="#listing-enquire">Enquire</a></li> <?php } ?> </ul> <div id="listing-description"> <?php the_content( __( 'View more <span class="meta-nav">→</span>', 'wp_listings' ) ); ?> </div><!-- #listing-description --> <div id="listing-my-sum"> <?php $details_instance = new WP_Listings(); $pattern = '<tr class="wp_listings%s"><td class="label">%s</td><td>%s</td></tr>'; if ( get_post_meta( $post->ID, '_listing_my_sum', true) != '' || get_post_meta( $post->ID, '_listing_kitchen_sum', true) != '' || get_post_meta( $post->ID, '_listing_living_room', true) != '' || get_post_meta( $post->ID, '_listing_master_suite', true) != '') { ?> <p class="value"><?php echo do_shortcode(get_post_meta( $post->ID, '_listing_my_sum', true)); ?></p> <?php } ?> </div><!-- #listing-details --> <?php if (get_post_meta( $post->ID, '_listing_gallery', true) != '') { ?> <div id="listing-gallery"> <?php echo do_shortcode(get_post_meta( $post->ID, '_listing_gallery', true)); ?> </div><!-- #listing-gallery --> <?php } ?> <?php if (get_post_meta( $post->ID, '_listing_local_amenities', true) != '') { ?> <div id="listing-local-amenities"> <div class="iframe-wrap"> <?php echo get_post_meta( $post->ID, '_listing_local_amenities', true); ?> </div> </div><!-- #listing-local-amenities --> <?php } ?> <?php if (get_post_meta( $post->ID, '_listing_apartment', true) != '') { ?> <div id="listing-apartment"> <p> <?php echo do_shortcode(get_post_meta( $post->ID, '_listing_apartment', true)); ?> </p> </div><!-- #listing-apartment --> <?php } ?> <?php if (get_post_meta( $post->ID, '_listing_enquire', true) != '') { ?> <div id="listing-enquire"> <p> <?php echo do_shortcode(get_post_meta( $post->ID, '_listing_enquire', true)); ?> </p> </div><!-- #listing-enquire --> <?php } ?> </div><!-- #listing-tabs.listing-data --> <?php if (get_post_meta( $post->ID, '_listing_map', true) != '') { echo '<div id="listing-map"><h3>Location Map</h3>'; echo do_shortcode(get_post_meta( $post->ID, '_listing_map', true) ); echo '</div><!-- .listing-map -->'; } ?>Thanks!!
Your theme is compatible with WPML so you can use a wpml-config.xml to translate these strings.
Here a topic about how build a wpml-config.xml and the Polylang documentation “The WPML language configuration file”
I made you an example with your taxonomy bedroom, I tested it and it works. Now you can translate these strings in Languages > tab “Strings translation”:
<wpml-config> <admin-texts> <key name="wp_listings_taxonomies"> <key name="bedroom"> <key name="labels"> <key name="name" /> <key name="singular_name" /> <key name="menu_name" /> <key name="search_items" /> <key name="popular_items" /> <key name="all_items" /> <key name="edit_item" /> <key name="update_item" /> <key name="add_new_item" /> <key name="new_item_name" /> <key name="add_or_remove_items" /> <key name="choose_from_most_used" /> </key> </key> </key> </admin-texts> </wpml-config>Edit: I saw in your copy screen “Property types”: you didn’t link your french and chinese post to the original english post. You must have a pen icon instead a plus sign.
HI Chrystl
Thanks again for the quick reply!
I created a wpml-config.xml file and used the code you gave me, also i added in the price range and length of stay, and it worked perfectly!! Thank you!
But I just couldn’t find any options for the Locations. see here
I tried to use the same code as apartment type and price range… still didnt work.<key name="locations"> <key name="labels"> <key name="name" /> <key name="singular_name" /> <key name="menu_name" /> <key name="search_items" /> </key> </key>Maybe it is because those taxonomies(apartment type and price range etc.) were I added manually, but Locations is came with the plugin originally.
So in this case, is there anything i need to change?And about those grey tabs i mentioned before, I also couldnt translate those. I tried to use something like this:
<custom-fields> <custom-field action="translate">Description</custom-field> <custom-field action="translate">amenities</custom-field> </custom-fields>but didnt work. ( those tabs id is “listing-tabs” , class is “listing-data” )
I also tried:<key name="listing-tabs"> <key name="listing-description"> <key name="listing-data"> <key name="name" /> <key name="singular_name" /> <key name="menu_name" /> <key name="search_items" /> </key>didnt work either… here is where i fill the description so i guess that shoulnt be a taxonomy.
Also about the Property types, Im sorry I copied the wrong one – I dont use that one, I use the “Apartment type”, which i created before. but this one works thats ok.
I’ve been trying to figure this out almost the whole day, but still dont know how.
anyway, Thanks again for the reply! at least im making progress!Cheers!
but Locations is came with the plugin originally.
Use Codestyling Localization to translate these strings.
Hi Chrystil
Thanks! The search engine part is all been sorted out!
Just that do you know how to translate those tabs as well? (I have put the text that needs to be translated in a square.)
see here
cause in the Codestyling Localization i dont see any options for the tabs.Thank you!
These strings are certainly in other options of your theme but not in the “wp_listings_taxonomies” options.
Where do you fill the string “Description” “Apartement type” “Sq Ft”?
Even for your slider, where do you fill “Living room” + Bedroom” ?
For the slider, its just part of the other plugin, its like a text layer it will show whatever i type in, so i could change that easily.
Thanks!
For F: you can translate them with codestyling Localization. I made a test it works.
For your other strings:
Go in your database => wp_options: make a search with one your strings: description or amenities or apartments etc…
You will find a result in option_name column: an option name of your plugin. Put this option name like this<wpml-config> <admin-texts> <key name="write here the option name">Then you must find the names of each options in option_value columns. You will find a long string. Paste it here I will help you to unserialize it.
It exists a plugin to explore its database for phpmyadmin to find your option name and otpion values. I never tested it. Here an user tested it with sucess
Hi Chrystl
So I went to my database then wp_options, I really dont seem to find those stings of my tabs is that hidden somewhere? Though I found the options for my search (the taxonomies).
I made a search but nothing showed up.
Do you know why?
Thank you!
The topic ‘Frontend strings translation’ is closed to new replies.