New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translation #974
Comments
@understrap/translation-team |
Bouncing that issue. I really support @filipw-trafikbyran ´s suggestion. Keep WooCommerce translation strings to woo and do not overwrite them with understrap translations. That´s been an issue to my own implementations also. @understrap/woocommerce-team whaya saying? |
As i remember it off the top of my head, we can't do that because the theme won't get accepted by the WordPress theme review team |
Having more than 1 text domain inside of a single theme causes issues when it comes to auto-distributed language packs for themes that are available from the .org servers. When I say it causes issues I mean it might just break it completely lol In the past it couldn't handle multiple text-domains at all - however that may have changed and is worth investigation if anyone has time. Due to the limitations on the language pack distribution system the Theme Review Team recommendation has been: you should have 1 text-domain used through the entire theme. Themes can make use of a 2nd text domain if they want to but it breaks the ability for .org server to correctly send translations for the theme if any exist. In many cases that's not a problem because themes aren't always translated - but this theme does have translations available here: https://translate.wordpress.org/projects/wp-themes/understrap/ |
As this topic comes up again and again. We should probably start researching and coming up with ideas to address this as @pattonwebz suggest |
Hi ! it seems that templates are overloaded especially to add markup (buttons, row, cols).
For example for buttons
|
Hey Marie! Seems like a really good idea to me in general, @MarieComet - but that doesn´t solve the translation issue or did I get something wrong? Or could we get rid of some templates completely by just adding that tiny piece of code? To be verbose: are some templates just there to add some button-styles and none else at all? |
Hey That should solve the translation issue if WooCommerce templates are not overriden by the theme, because strings will not be overriden by Understrap textdomain anymore, so no need to translate and update them. And yes, there is a lot of templates overriden by Undestrap "just" to add some button CSS classes. |
If I found some times for that I will test the idea above (CSS instead of markup in template), and see how many templates can be deleted from Understrap. |
Sidenote: Personally I erase all that WooCommerce-stuff from Understrap by now. I just override/inject styles with custom functions/actions/hooks That may be not very intuitive, but according to my experience, works best. |
Any sincere solutions to it that would benefit all both lang-domains? There MUST be one, or WP is lacking a solution for plugins.. But that´s my opinion Trying to bounce that issue with my comment ;) |
Isn't it possible just to copy the Woocommerce mo/po files to understrap and not bother with the translation at all? Understrap does not change any of the strings, just adds proper Bootstrap markup, right? So, does translating Woocommerce default strings here actually make sense: Or am I missing something? |
Where is the benefit over copying/including the default strings under the "woocommerce" domain into a theme domain ("understrap") which is not allowed anyway, if i´m not all wrong. If you "copy" them with a theme update, they will get overwritten anyway. |
Well, it would mean that all the strings that have alreadt been translated within woocommerce would not have to be translated again by the child theme or understrap just because the domain had been changed. I am not an expert Wordpress / WPML translator, but there does not seem to be an option to display already translated string from one translation domain (i.e. woocommerce) for exactly the same string in another domain (i.e. understrap or child-theme). |
Well, yes this has been a problem from past to present. Can´t tell anymore what was causing it though. As far as I recall, on WP.org there cannot be any themes submitted with two language domains. I may be wrong, never personally contributed to WP.og. I´d try to reach @UnderstrapFramework if I was you and ask what´s the case with that. Maybe he, the repo owner, can shed some light? |
I just checked and word from the theme review team is that while the automated tests will throw a warning about multiple language domains, it's only a warning, and using more than one is allowed in repository themes. So when I start updating Woocommerce ( after Bootstrap 5 ), I'll both look for opportunities to switch away from template use and move all woocommerce translation strings to their domain. |
Of course, if anyone else has a burning desire to take this one, jump in! But I think some templates only exist for bootstrap classes and I'm not sure how that will change in the update to 5. |
Closing with the launch of 1.0.0. |
Problem:
Some Woocommerce strings in ex the cart don't translate to Swedish as the rest of the shop does.
Suggestion:
I have seen a lot of others haveing simalar problems to me. That Understarp tries to translate Woocommerce string with it's own translations files instead of the Woocommerce translationsfiles for strings that are not changed from the woocommerce templates other than some classes and colors. Wouldn't it be better to just use the Woocommerce translations? For example in the SE translation file these string don't exist and it would be a hassle to keep them updated anyway since it would just be copy paste from the woocommerce templates.
EX:
Row 95 to 98 in cart.php in understrap :
<td class="product-price" data-title="<?php esc_attr_e( 'Price', 'understrap' ); ?>"> <?php echo apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key ); // PHPCS: XSS ok. ?> </td>
Row 95 to 98 in cart.php in woocommerce templates:
<td class="product-price" data-title="<?php esc_attr_e( 'Price', 'woocommerce' ); ?>"> <?php echo apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key ); // PHPCS: XSS ok. ?> </td>
there is other cahnges made to this file, that's why it exist, but i don't see the reason for using the understrap translations over the woocommerce once.
So i suggest that Woocommerce translations are to be used in all of the woocommerce files
The text was updated successfully, but these errors were encountered: