{"id":54968,"date":"2020-01-09T20:41:54","date_gmt":"2020-01-09T19:41:54","guid":{"rendered":"https:\/\/samuelchopard.ch\/wiki\/?p=54968"},"modified":"2020-03-28T14:26:53","modified_gmt":"2020-03-28T13:26:53","slug":"translate-credit-card-fields-placeholders-for-woocommerce-stripe","status":"publish","type":"post","link":"https:\/\/samuelchopard.ch\/wiki\/library\/translate-credit-card-fields-placeholders-for-woocommerce-stripe\/","title":{"rendered":"Translate credit card fields placeholders for WooCommerce Stripe"},"content":{"rendered":"<p><!--more--><br \/>\nPaste the following in functions.php:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">add_filter( 'wc_stripe_elements_options', 'wc_update_locale_in_stripe_element_options' );\r\nfunction wc_update_locale_in_stripe_element_options( $options ) {\r\n    return array_merge(\r\n        $options,\r\n        array(\r\n            'locale' =&gt; get_locale(),\r\n        )\r\n    );\r\n};<\/pre>\n<p><em>get_locale()<\/em> will automatically translate the fields to the browser&#8217;s language. For a specific language, use language code between quotation marks, for example <em>&#8216;fr&#8217;<\/em> for French.<\/p>\n<p>Source: <a target=\"_blank\" href=\"https:\/\/docs.woocommerce.com\/document\/stripe\/#section-33\">https:\/\/docs.woocommerce.com\/document\/stripe\/#section-33<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"Paste the following in functions.php: add_filter( 'wc_stripe_elements_options', 'wc_update_locale_in_stripe_element_options' ); function wc_update_locale_in_stripe_element_options( $options ) { return array_merge( $options, array( 'locale' =&gt; [...]","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[113,368,327],"class_list":["post-54968","post","type-post","status-publish","format-standard","hentry","category-woocommerce","tag-form","tag-stripe","tag-woocommerce"],"_links":{"self":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/54968","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/comments?post=54968"}],"version-history":[{"count":3,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/54968\/revisions"}],"predecessor-version":[{"id":55004,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/54968\/revisions\/55004"}],"wp:attachment":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/media?parent=54968"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/categories?post=54968"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/tags?post=54968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}