# I18n translate label and value form in template

**URL:** <https://discourse.laminas.dev/t/i18n-translate-label-and-value-form-in-template/2120>\
**Category:** Components & MVC\
**Created:** [February 20, 2021, 1:08am UTC](https://discourse.laminas.dev/t/i18n-translate-label-and-value-form-in-template/2120 "2021-02-20T01:08:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kriss\_Kals](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/kriss_kals/32/1295_2.png) [@Kriss\_Kals](https://discourse.laminas.dev/u/Kriss_Kals)\
**Post date:** [February 20, 2021, 1:08am UTC](https://discourse.laminas.dev/t/i18n-translate-label-and-value-form-in-template/2120/1 "2021-02-20T01:08:13Z")

</div>

As in the topic. I have set the main language for the application, but I would like to change some form elements (label or value) already in the theme. Is there a way to do it?

Thank you for your answers

---

<div class="post-metadata">

**Author:** ![froschdesign](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/froschdesign/32/38_2.png) [@froschdesign](https://discourse.laminas.dev/u/froschdesign)\
**Post date:** [February 22, 2021, 11:34pm UTC](https://discourse.laminas.dev/t/i18n-translate-label-and-value-form-in-template/2120/2 "2021-02-22T23:34:00Z")

</div>

> [@Kriss\_Kals](#):
>
> …I would like to change some form elements (label or value) already in the theme.

I’m sorry, but I don’t understand exactly what you’re trying to do. You want to add translations in the view script / template?  
Maybe you can provide some code or _pseudo_ code to show your intention.

---

<div class="post-metadata">

**Author:** ![Kriss\_Kals](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/kriss_kals/32/1295_2.png) [@Kriss\_Kals](https://discourse.laminas.dev/u/Kriss_Kals)\
**Post date:** [February 23, 2021, 10:27am UTC](https://discourse.laminas.dev/t/i18n-translate-label-and-value-form-in-template/2120/3 "2021-02-23T10:27:35Z")

</div>

Hi,

I solved the problem by injecting an instance of the Translator class into the Form along with an additional language parameter (different from global). Thread to close.

Best regards

---

<div class="post-metadata">

**Author:** ![froschdesign](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/froschdesign/32/38_2.png) [@froschdesign](https://discourse.laminas.dev/u/froschdesign)\
**Post date:** [February 23, 2021, 11:02am UTC](https://discourse.laminas.dev/t/i18n-translate-label-and-value-form-in-template/2120/4 "2021-02-23T11:02:34Z")

</div>

> [@Kriss\_Kals](#):
>
> I solved the problem by injecting an instance of the Translator class into the Form along with an additional language parameter (different from global).

The translation is done in the view layer and not in the form itself. You can [set a different translator](https://docs.laminas.dev/laminas-form/helper/abstract-helper/#translation) for the related view helper but maybe a different locale or [translation text domain](https://docs.laminas.dev/laminas-i18n/translation/#adding-translations) is enough for your use case.

> [@Kriss\_Kals](#):
>
> Thread to close.

[Can mark an answer as solution.](https://meta.discourse.org/t/discourse-solved-accepted-answer-plugin/30155)
