nggettext - Translate a text has <a> tag inside it - angularjs

I am trying to translate this text.
<label class="check" translate>
<input type="checkbox" name="tnc" ng-init="tnc=false" ng-model="tnc" /> I agree to the <a ng-click="open('terms.html')">
Terms of Service </a> & <a ng-click="open('privacy.html')">
Privacy Policy </a>
</label>
I ran 'grunt nggettext_extract' and it extracted source text as
<input type="checkbox" name="tnc" ng-init="tnc=false" ng-model="tnc"> I agree to the <a ng-click="open('terms.html')">
Terms of Service </a> & <a ng-click="open('privacy.html')">
Privacy Policy </a>
and I translated it like that
<input type="checkbox" name="tnc" ng-init="tnc=false" ng-model="tnc"><a ng-click="open('terms.html')">
Kullanım Şartları </a>'nı & <a ng-click="open('privacy.html')">
Gizlilik Sözleşmesi</a>'ni kabul ediyorum
After that, I ran 'grunt nggettext_compile'. It said 'Done, without errors.' but in my page, it says '[MISSING]'.
How can I correct it?
Thank you.

Related

How to move checkbox of terms and conditions up [odoo 13]

does anyone know how to move the conditions and positions checkbox up? I found the code for this checkbox in odooenter image description here and it has this parameter, but when I change the state of this parameter to "before", nothing happens
odoo version 13.0, ecommerce module
code of checkbox
<template id="payment_sale_note" inherit_id="payment" name="Accept Terms & Conditions" customize_show="True" active="True">
<xpath expr="//div[#id='payment_method'][hasclass('js_payment')]" position="before">
<div class="custom-control custom-checkbox float-right mt-2 oe_accept_cgv_button">
<input type="checkbox" id="checkbox_cgv" class="custom-control-input"/>
<label for="checkbox_cgv" class="custom-control-label">
I agree to the <a target="_BLANK" href="/shop/terms">terms & conditions</a>
</label>
</div>
</xpath>
</template>
In my odoo v13, i have managed it like that :
<template id="my_payment_tokens_list" inherit_id="payment.payment_tokens_list" >
<xpath expr="//form[hasclass('o_payment_form')]/div[1]" position="before">
<div class="pl-4 mb-3">
<input type="checkbox" id="checkbox_cgv" class="custom-control-input" required="This field is required"/>
<label for="checkbox_cgv" class="custom-control-label"> I agree with <a target="_BLANK" href="/shop/terms"><u>General Terms and Conditions of Sale</u></a></label>
</div>
</xpath>
</template>

How to play music using AngularJS from selected file

This is my
code
<form name="downloadForm" role="form" ng-submit="download()">
<label>
files :
</label>
<div class="form-group">
<label class="radio left-buffer-medium" ng-repeat="file in product.issueDTO.source track by file.id">
<input type="radio" name="fileRadio" ng-model="$parent.selectedFile.id" ng-value="{{file.id}}"
ng-checked="($parent.selectedFile.id == file.id)">{{file.sourceType.extension}}
<small>{{file.fileDescription}}</small>
</label>
</div>
<button type="submit" class="btn btn-primary">
<span class="glyphicon glyphicon-download-alt" ></span>
<span translate="qstoreappApp.product.publicproducts.download"></span>
</button>
<br>
<audio controls>
<source src="????" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</form>
I use it to select a file to download, and everything is works. I would like to use mp3 player from HTML5, my question is. How i can send a patch to src ?
I've tried with file.filePath, but it does'nt works.
You can use ng-src
<source ng-src="http://localhost:3000/tracks/{{ ngmodelSong}}" type="audio/mpeg">

can't get data from ng-model using signalr

here is my .html :
<ul class="messages list-unstyled" ng-repeat="newMessage in messages">
<li>
<p>
<span class="username">{{newMessage.username}}</span><br />
</p>
<p>
<span> {{newMessage.message}}</span>
</p>
<p class="no-pad-bottom date-posted">Send {{ newMessage.date }} <span /></p>
<div class="comments">
<ul class="list-unstyled" ng-repeat="newComment in comments">
<li>
<p>
<span class="commentor"> {{newComment.username}}</span>
<span> {{newComment.message}}</span>
</p>
<p class="no-pad-bottom date-posted">Send {{ newComment.date }} <span /></p>
</li>
</ul>
<form class="add-comment">
<div class="row">
<div class="col-md-10">
<input type="text" class="form-control" ng-model="myComment" placeholder="Add a comment" />
</div>
<div class="col-md-2">
<button class="btn btn-default btn-sm" type="submit" ng-click="addComment(newMessage.id)">Comment</button>
</div>
</div>
</form>
</div>
</li>
</ul>
everything is working. i can send my messages, and i can even send posts, but i get null from ng-model="myComment"
here is the method in js controller
$scope.addComment = function (messageId) {
myChatHub.server.addComment(messageId, userName, $scope.myComment);
};
can you please tell me what's wrong?
You are breaking the golden rule of always having a dot in ng-model .. or in other words using an object
ng-repeat creates a child scope and your primitive assigned to ng-model therefore only exists in the child scope since primitives have no inheritance.
Create model object in controller
$scope.model={}
And then use that ng-model="model.myComment" and change your post to:
$scope.addComment = function (messageId) {
myChatHub.server.addComment(messageId, userName, $scope.model.myComment);
};
This 3 minute video will be very enlightening

Dynamically add UI Bootstrap dropdowns with ng-repeat

I'm new to using AngularJS and UI Bootstrap and I'm trying to add dropdowns dynamically using ng-repeat. The problem is that when any one dropdown is clicked it triggers all of them. I'm guessing I'm doing something really stupid with my code and I would appreciate it if someone could point me in the right direction on how to make this code work:
<div class="form-group" data-ng-repeat="item in ctrl.items">
<div class="col-sm-4">
<input type="text" class="form-control" placeholder="" name="itemDescription" data-ng-model="item.description">
</div>
<div class="col-sm-5">
<div class="input-group">
<input type="tel" class="form-control" placeholder="" name="value" data-ng-model="item.value">
<div class="input-group-btn" dropdown is-open="ctrl.isOpen">
<button type="button" class="btn btn-default dropdown-toggle" dropdown-toggle>Dropdown <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
<li></li>
</ul>
</div>
</div>
</div>
The problem is that with more than one dropdown, a click results in all dropdowns being triggered and its probably something really easy but I'm having a hard time with it.
Appreciate any help
/Regards Kris
The issue is is-open="ctrl.isOpen". You are binding the opening of all of them with ctrl. It should be bound to something distinct for each repeat, i.e. something like is-open="item.isOpen"

Text in Textarea is not scrolling with ng-repeat with ionic- angular js

When i using textarea below the ng-repeat in angular js - ionic . The text area is not working properly and some time lost it focus also. Please provide me solution for that this is my code :
<div class="title">Comments</div>
<ul class="comment_list">
<li ng-repeat="x in comments ">
<a><img no-image ng-src="{{profile_img_path.image_url_tiny+x.User.image}}" alt="" class="pro_img"></a>
<div class="pro_deatil" >
<h2> {{x.User.name}} </h2>
<p>{{x.CommentDish.comment}}</p>
</div>
<div class="pro_like" >
</div>
<div class="clearfix"></div>
</li>
</ul>
<div class="comment">
<textarea name="comment" rows="5" cols="10" ng-model="comment_data.comment" placeholder="Enter Comment" class="post_txt_area" overflow-scroll="true"></textarea>
<div> <a ng-click="postComment()" class="event_btn">Comment</a> </div>
</div>
Please help me if anyone has solution for this issue....

Resources