My angular controller can generate messages that I intend to translate using angular translations.
In the controller, I currently assign a variable to the broadcast key , for example:
$scope.info = "core.projectconfig.created";
where this key has its own translation, indicated as
core.projectconfig.created <=> 'Project {{projectName}} created successfully'
As you can see, I also need to replace the project name in the translation.
I tried something like this in my opinion
<P translate="{{info}}", translate-values="{projectName : projectData.ProjectName}"></p>
but that will not work. How can I translate a dynamically found translation key, and also add a scope variable to the translated string?
javascript angularjs angular-translate
Askar ibragimov
source share