Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make Snippet Linktext changeable #8

Closed
anselmh opened this issue Dec 20, 2010 · 2 comments
Closed

make Snippet Linktext changeable #8

anselmh opened this issue Dec 20, 2010 · 2 comments

Comments

@anselmh
Copy link

anselmh commented Dec 20, 2010

Would be great to can change the text of the Frontend Snippet language strings.
Currently (as I far as I know) the only option is to change the names for the backend in lexicon?

@mikrobi
Copy link
Owner

mikrobi commented Dec 21, 2010

There's no need to change anything on Babel. You can do this already in several ways:

  1. Use the default babelLink chunk and change the lexicons entries for babel.language_xy (as you said). But remember: this will also change the labels in the manager!
  2. Create your own chunk and your own lexicon entries e.g. mysite.language_xy and in the chunk you'll use
    [[%mysite.language_[[+cultureKey]]? &namespace=your-namespace &topic=your-topic]]
  3. Create your own chunk and a snippet which generates the labels out of the cultureKey: Chunk:
    <a href="[[+url]]>[[mySnippet? &cultureKey=[[+cultureKey]]

And in your snippet something like that:
$cultureKey = $modx->getOption(....);
$output = '';
switch ($cultureKey) {
case 'en':
$output = 'English Version';
break;
case 'de':
$output = 'German Version';
break;
default: $output = '???';
}
return $output;

I hope this helps.

Cheers,
Jakob

@anselmh
Copy link
Author

anselmh commented Dec 21, 2010

Okay, didn't know that. Found that 2nd solution seems to be the best. No need for another snippet etc. and easy to manage.

best,
Anselm

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants