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

Translatable object name in success message #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Translatable object name in success message #8

wants to merge 2 commits into from

Conversation

faloude
Copy link

@faloude faloude commented Jul 29, 2016

Replaced singular_name() with i18n_singular_name() for translatable object names. These are now easily translatable with .yml files.

Faloude added 2 commits July 29, 2016 22:58
Replaced `singular_name()` with `i18n_singular_name()` for translatable object names. These are now easily translatable with .yml files.
Shows only the DataObject name instead of both DataObject name + Record
name
'name' => $object->singular_name(),
'link' => $link
'name' => $object->i18n_singular_name(),
'link' => ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has this been removed? If we're removing it can we remove the {link} field and delete the array key?

Copy link
Author

@faloude faloude Aug 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This _t() function refers to GridFieldDetailForm.Saved in the framework lang file framework/lang/nl.yml which has this value:

Saved: '{name} {link} opgeslagen'

The translation file is expecting a {link} so completely removing 'link' => $link from the array would leave a meaningless DataObject saved {link} in the success-message, whereas an empty value for 'link' doesn't leave any marks. If we would remove {link} from the array we would need to remove it from each and every framework lang file which isn't desired obviously.

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

Successfully merging this pull request may close these issues.

2 participants