lforms
lforms copied to clipboard
Translation file?
I am trying to translate and build the partials. Is there another method?
"npm run build" should build the package. However, there are pre-built versions here: https://clinicaltables.nlm.nih.gov/lforms-versions
Maybe you mean that you are translating the English words in the partials into another language? That is not something we have tried to do, but modifying the partials and rebuilding is probably the way to go. Let us know how that works out. It might be something we should add a configuration file for.
I just came across "angular-translate", which would let you switch between languages rather than just having one language. If you decide to go that route, we would welcome a pull request.
Oh thanks, I only know datatables, in the instance, the langs file url is specified in .json. If not, will be default english. May be an options in the addFormToPage() or in the form definition. The second way is perfect.
I was looking at the angular translation, but I don't know how integrated into the project, I don't know the framework sorry. I have the lang translation en.json. I'm no t sure. In the partials, translation may be:
<div class="lf-form-option">
<label for="viewMode">View mode</label>
<select name="viewMode" ng-model="lfData.templateOptions.viewMode">
<option value="auto">Responsive [auto]</option>
<option value="lg">For large screen [lg]</option>
<option value="md">For medium screen [md]</option>
<option value="sm">For small screen [sm]</option>
</select>
</div>
For:
<div class="lf-form-option">
<label for="viewMode">{{ 'ViewMode' | translate }}</label>
<select name="viewMode" ng-model="lfData.templateOptions.viewMode">
<option value="auto">{{ 'ResponsiveAuto' | translate }}</option>
<option value="lg">{{ 'ForLargeScreenLG' | translate }}</option>
<option value="md">{{ 'ForMedium screenMD' | translate }}</option>
<option value="sm">{{ 'ForSmallScreenSM' | translate }}</option>
</select>
</div>
But, I have not idea.