Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Display Username instead of "You"
Hey!
I have a problem translating Vanilla into german because you can't translate everythink 1:1 ...
For example, when a user changes his/her picture, I can't use the concept which works for the english language..
Therefore I would need to be able to use the username:
$Definition['Activity.PictureChange.FullHeadline'] = 'USERNAME Profilbild wurde geändert.';
$Definition['Activity.PictureChange.ProfileHeadline'] = 'USERNAME Profilbild wurde geändert.';
So, how can I use the username as a variable in local.php?
Thanks a lot!
Clemens
I have a problem translating Vanilla into german because you can't translate everythink 1:1 ...
For example, when a user changes his/her picture, I can't use the concept which works for the english language..
Therefore I would need to be able to use the username:
$Definition['Activity.PictureChange.FullHeadline'] = 'USERNAME Profilbild wurde geändert.';
$Definition['Activity.PictureChange.ProfileHeadline'] = 'USERNAME Profilbild wurde geändert.';
So, how can I use the username as a variable in local.php?
Thanks a lot!
Clemens
Tagged:
0
Best Answer
-
UnderDog MVPYou have to use a variable, but then the problem is that you need to change some things in the source too. I will give you an example. No guarantees that it works out of the box.
$Definition['Activity.PictureChange.FullHeadline'] = '%s Profilbild wurde geändert.';
See the%s
that's the variable. Now in the source you need to change it so that the variable is used. Most likely with the sprintf function.
There are also some examples in the source already and some threads on the forum with some examples.There was an error rendering this rich post.
0
Answers
$Definition['Activity.PictureChange.FullHeadline'] = '%s Profilbild wurde geändert.';
See the%s
that's the variable. Now in the source you need to change it so that the variable is used. Most likely with the sprintf function.There are also some examples in the source already and some threads on the forum with some examples.
There was an error rendering this rich post.
$user = THE_USERNAME and then..
$Definition['Activity.PictureChange.FullHeadline'] = '$user Profilbild wurde geändert.';
The problem is I don't know where to start to solve the problem, my PHP skills are very... bad..
Thx
I don't know if this helps, but
%9$s
will be replaced with a gender suffix which some users requested and put in the code. Perhaps you can put that in your headline and see what comes out.i am also interested in this. where can i change which variable is used in the source?