Skip to content

Translatable object name in success message#8

Open
faloude wants to merge 2 commits into
isobar-nz:masterfrom
faloude:patch-1
Open

Translatable object name in success message#8
faloude wants to merge 2 commits into
isobar-nz:masterfrom
faloude:patch-1

Conversation

@faloude

@faloude faloude commented Jul 29, 2016

Copy link
Copy Markdown

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
Copy Markdown
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?

@faloude faloude Aug 1, 2016

Copy link
Copy Markdown
Author

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