Needs work
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Tax
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Sep 2011 at 09:12 UTC
Updated:
27 Jun 2018 at 17:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jserveaux commentedThe patch above considere the tax title translation.
Comment #2
rszrama commentedHmm, well, we cannot translate it by wrapping a variable with t(), as that function is reserved for string literals. What we'll need is some way to integrate with a translation module to expose those fields to translation interfaces. I don't have a lot of experience here, but you might ping das-peter in IRC about it.
Comment #3
das-peter commentedSince taxes aren't entities ( or do I miss something - there's no hook_entity_info()) we can't use the entity_translation / title team.
Looks like a case for i18n / i18n_strings - but my experience with this modules is very limited.
Comment #4
svendecabootersubscribing.
It seems the best solutions (Title or Entity Translation) modules will not be able to help here, because the Taxes are no entity (?) or if they are, not a fieldable entity.
Edit:
Didn't see peter's reply yet. I'll check how we can translate this. http://drupal.org/project/variable perhaps, but I don't think it's a variable either.
Will have to dive into the code some more
Comment #5
thijsvdanker commentedHas this ever been solved? (maybe in another issue.. wishfull thinking? :))
Comment #6
daghansa commentedI am having the same problem, is this issue solved?
Comment #7
cspitzlayThis patch implements translation of user-defined strings in tax rates and tax types via i18n_string.
Make sure you check "Commerce tax" and hit "Refresh strings" on the string admin page:
admin/config/regional/translate/i18n_string
Then you should be able to translate the strings on the regular interface at:
admin/config/regional/translate/translate
Please let me know if it works for you.
Comment #8
cspitzlayComment #9
cspitzlayHere is a revised version of the patch that makes translation of tax rates and tax types independent from each other.
Comment #10
cspitzlayIMHO this is (no longer) a support request.
Comment #11
rszrama commentedFair enough, but let's categorize it as a feature request, as there is no actual bug in the code, just lack of integration with a third party module.
Comment #12
star-szrThanks for this patch, @cspitzlay. I've made a few changes:
sanitize => FALSEoption to prevent double encoding. Without this, I think tax rates and types end up going through check_plain() twice and if you have an apostrophe, ampersand, etc. in your translation it will be double encoded.Comment #13
star-szrActually, I think "Tax" should be capitalized on the string refresh page because it refers to the module - "Commerce Tax" instead of "Commerce tax". I've left "Commerce tax rate" and "Commerce tax type" as is.
Comment #14
star-szrSorry for the noise! I found one more instance to be capitalized, and replaced the double quotes in 'description' at the same time.
Comment #15
star-szrUnfortunately this seems to have a similar bug as reported in #1480654-5: Use i18n string to translate the title or display_title of the flat rate shipping services. where the translated values are sometimes displayed in the tax rate/tax type edit form. The edit forms should always contain the untranslated values, so setting to CNW for now.
Steps to reproduce:
Comment #16
star-szrSee http://drupal.org/node/1534468 for more information about why the double encoding is happening. Internationalization's i18n_string() API changed in i18n 1.5.
Comment #17
vasikethe issue with last patch is that use the translation values in all cases, including the Tax forms - inside commerce_tax_types() and commerce_tax_rates() functions.
i also found that the Commerce Tax (groups) strings are not updated.
here is patch that should fix these issues.
Comment #18
bojanz commentedShould be rerolled on top of #1121722: Improve DX of instance translation since it has a commerce_i18n_object function that you can use to translate an entire object, instead of doing things like:
We should also try to use the "commerce" group (introduced by #1196488: Allow checkout completion message to be translated) instead of defining a "commerce_tax" group.
Comment #19
vasikeof course mister bojanz. it was only an intermediate step.
here is a patch that uses both commerce_i18n_object() function and "commerce" as translation group from the other issues patches.
Comment #21
rszrama commented#19: commerce_tax_i18n-1270624-19.patch queued for re-testing.
Comment #22
shaneonabike commentedJust tagging this
Comment #23
shaneonabike commentedFor the record this issue also relates to shipping titles not being passed through the translate interface either... just thought I might mention it.Sorry I just saw this was reported earlier
Comment #24
heorhi lazarevich commentedPatch #19 works for me with Commerce 7.x-1.8
Comment #25
kaido.toomingas commented#19 Worked for me too using Commerce Kickstart
Comment #26
MURANJO commented#19 worked for me too. I also included the patch for the shipping service translation (https://drupal.org/node/1480654). Both are working fine now although in my first try, the shipping service didn't appear in the summary cart. Many thanks!!
Comment #27
doxigo commentedWhen I try to Patch using #19, it asks me what file to patch, as far as I noticed from the Patch it also tries to create a new file called commerce_tax.i18n.inc
Can anyone explains the patching process here since it doesn't really make any changes to the current files?
and also is this issue fixed on latest commerce release ?
Comment #29
screon commentedWith the patch from #19 applied, my PHP goes out of memory when I refresh my site. My PHP memory is currently set at 512M.
Does anyone else experience this issue?
Comment #30
ordermind commentedI'm getting the following error message after applying this patch and trying to save a tax:
PHP Fatal error: Call to undefined method i18n_object_wrapper::strings_update() in .../profiles/kepler/modules/contrib/i18n/i18n_string/i18n_string.module on line 851, referer: .../admin/commerce/config/taxes/rates/swedish-vat-25/edit
Comment #31
goz commentedThis patch is in conflict with rules_i18n. This make an infinite loop : commerce_tax_commerce_price_component_type_info() call commerce_i18n_object() which call rules_i18n module which call commerce_tax_commerce_price_component_type_info() too.
Comment #32
joel_osc commentedSeeing this too... flush cash and view your cart triggers infinite loop. Not sure it is this patch that is doing anything wrong. Disabled rules_i18n and everything works.