lforms icon indicating copy to clipboard operation
lforms copied to clipboard

Translation file?

Open medicamecanica opened this issue 4 years ago • 5 comments

I am trying to translate and build the partials. Is there another method?

medicamecanica avatar Apr 22 '20 05:04 medicamecanica

"npm run build" should build the package. However, there are pre-built versions here: https://clinicaltables.nlm.nih.gov/lforms-versions

plynchnlm avatar Apr 22 '20 13:04 plynchnlm

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.

plynchnlm avatar Apr 22 '20 14:04 plynchnlm

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.

plynchnlm avatar Apr 22 '20 15:04 plynchnlm

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.

medicamecanica avatar Apr 25 '20 17:04 medicamecanica

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.

medicamecanica avatar Apr 25 '20 17:04 medicamecanica