Giray Posted June 13, 2022 Posted June 13, 2022 This is the English message that appears on screen right after registering (in language bits it’s reg_confirm_email_desc) Quote We sent an email to <strong>%s</strong>. It contains a link you need to click in order to confirm your account. The problem is that on my forum, after registering, that’s exactly what appears. The %s is not replaced by the person’s email. Thoughts? Thanks. SeNioR- 1
Marc Posted June 13, 2022 Posted June 13, 2022 I see thats a translated string there. If you revert this to its default, does this then work? Giray and SeNioR- 1 1
Giray Posted June 13, 2022 Author Posted June 13, 2022 Indeed, that was it. I removed the translated string. Note, however, that the only thing ‘off’ about the translated string was that it mentioned the email address a second time. Anyway, I’ll just leave it as is for now. Eventually, see if you can replicate?
Marc Posted June 13, 2022 Posted June 13, 2022 Could you please confirm exactly what you were trying to add? I have tagged our developers in the meantime to see if this is something that would work or not, with you trying to use the variable twice
Andy Millne Posted June 13, 2022 Posted June 13, 2022 If you are adding the same variable twice you can use the following format; %1$s e.g. "This is your email %1$s, and so is this %1$s. Neat!" Where there are two replacements already in a string you can use this to alter the order. e.g. "This is the second item %2$s, but this is the first %1$s"
Giray Posted June 13, 2022 Author Posted June 13, 2022 22 minutes ago, Andy Millne said: If you are adding the same variable twice you can use the following format; %1$s e.g. "This is your email %1$s, and so is this %1$s. Neat!" Where there are two replacements already in a string you can use this to alter the order. e.g. "This is the second item %2$s, but this is the first %1$s" Thanks Andy. I tried but failed 😞 I entered: We sent an email to <strong>%1$s</strong>. It contains a link you need to click in order to confirm your account. In the future, when you log in, you can either do so with your Callsign (or user name) or with your %2$s email. It gave me what you see above without the variable replacement. What did I do wrong?
Solution Andy Millne Posted June 13, 2022 Solution Posted June 13, 2022 Just now, Giray said: What did I do wrong? If the original untranslated string only has one %s then %2$s will not exist. You need to use %1$s for both times you want the replacement to occur. Giray and SeNioR- 1 1
Giray Posted June 13, 2022 Author Posted June 13, 2022 WORKED!!!!!!!! Thank you @Andy Millne SeNioR- and Andy Millne 2
Recommended Posts