I need the submit button to be translated based on the selected language. However, it currently always displays Submit in English, and I can’t find a way to change it for other languages (string replacement not work)
Our teacher doesn’t understand English, so I need to make sure the button text is properly translated when switching languages. Is there a way to achieve this?
Hi!
Are you sure that, if you change the local language on your browser to the one which doesn’t work, it still shows ‘submit’?
I just checked in the language files we use (Portuguese, English and German) and this is correctly translated in all instances.
Which languages do you use and aren’t working?
Thank you @Xavier_Bit .
I wonder if you have any way to help test using Simplified Chinese (zh_CN.UTF-8), which is also a language that has been 100% fully translated.
But I can’t upload the newest translated file in this post.
I have confirmed that my server locale, client browser language, and client operating system language are all set to Simplified Chinese (zh_CN), and the corresponding translation entries also exist.
Only English ‘Submit’ Text:
$row->addSubmit()
Available for localization:
$row->addSubmit(__('Submit'))
I hope the development team can add text to all addSubmit()
functions.
opened 02:51AM - 27 Feb 25 UTC
bug
### Describe the Bug
Improve createSubmit method to support dynamic translation…
https://github.com/GibbonEdu/core/commit/2ae46677f95f9932c9eabebcb0c5078e8e7894c3
I noticed that in src/Forms/FormFactory.php, the $label parameter is not wrapped with __(), which prevents the submit button text from being properly localized.
I have not created a pull request to avoid unintended changes affecting other users. I hope the developers can review this issue and apply the necessary fix.
### To Reproduce
return $this->createButton($label, null, $id)->setType('submit')->addClass('text-right');
### Expected behavior
return $this->createButton(__($label), null, $id)->setType('submit')->addClass('text-right');
### Actual behavior
Submit Button Label Not Translated in FormFactory.php
### Screenshots
_No response_
### Gibbon version
28.0.01
### Browser
Chrome
### Browser Version
_No response_
### Additional Context
_No response_
I have already modified the code in my local version, and it is working well. I hope the developers can review this issue and confirm the fix.
Thank you! @Xavier_Bit
1 Like