Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have this line in a angularjs controller:
My key in en.xml looks like this:
<key alias="settingsLoaded"><![CDATA[Settings for '%0%' are loaded!]]></key>
The value of $scope.mailbox.eMail is a string like this: [email protected]
But if I load my page with this custom property editor in a custom section I get only this notification:
The parameter is truncate to 1 char. Have anyone an explanation for this?
Or is the syntax for using a parameter in localizationService wrong? Unfortunately, I have not found this in the documentation on umbraco.github.io/belle/
I have a look into umbraco.services.js and I realized why it doesn't work.
I need to pass an array as a parameter instead of strings.
In my example above the code in angularjs controller must look like this:
$scope.tokens = ; $scope.tokens = $scope.mailbox.eMail; notificationsService.success(localizationService.localize("mail2cms_settingsLoaded", $scope.tokens));
I hope this helps anyone with similar problems.
A minor detail, but you don't actually need the "tokens" array. You can just do
Other than that you spared me a headache :-)
Hi SörenThanks for sharing thisI had a similar case, where I needed to translate the messages in the notifications.But I didn't need to pass any arguments - just use the translation key from the respective language file in /Umbraco/Config/Lang/
I managed to solve it like this:
where the language file hae a format like this:
<language alias="en" intName="English (UK)" localName="English (UK)" lcid="" culture="en-GB">
<key alias="settingsSaved">Settings have been saved</key>
<key alias="accountDetailsSaved">Account details have been saved</key>
<key alias="profileDetailsSaved">Profile details have been saved</key>
thank you. Yes, this is the way without passing any arguments and will work if you have language entries without variables.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted