Feature #3057

Allow custom my_page blocks to define drop-down names

Added by Brad Beattie over 8 years ago. Updated about 6 years ago.

Status:ClosedStart date:2009-03-26
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Plugin API
Target version:0.9.0
Resolution:Fixed

Description

I have a plugin that adds additional blocks to the my_page page. The only problem I have here is that I can't name the blocks beyond their file names, whereas core blocks define their localized names:

BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues,
             'issuesreportedbyme' => :label_reported_issues,
             'issueswatched' => :label_watched_issues,
             'news' => :label_news_latest,
             'calendar' => :label_calendar,
             'documents' => :label_document_plural,
             'timelog' => :label_spent_time
           }.merge(Redmine::Views::MyPage::Block.additional_blocks).freeze

This request is necessary in order to localize the plugin.

Associated revisions

Revision 2659
Added by Jean-Philippe Lang over 8 years ago

Set a default scope for 'My page' block names translations (#3057).

History

#1 Updated by Jean-Philippe Lang over 8 years ago

Actually, you can add a key in your locales that matches the partial name, eg:

_my_partial.rhtml => uses 'my_partial' translation key if available

Maybe we could use a prefix for these translations in locales, eg: 'my.blocks.my_partial' or something.
What do you think?

#2 Updated by Brad Beattie over 8 years ago

Jean-Philippe Lang wrote:

Actually, you can add a key in your locales that matches the partial name, eg:

_my_partial.rhtml => uses 'my_partial' translation key if available

Maybe we could use a prefix for these translations in locales, eg: 'my.blocks.my_partial' or something.
What do you think?

Hrm. A prefix would be nice as it would help avoid any unintended overlap. Not necessary, but nice.

#3 Updated by Jean-Philippe Lang over 8 years ago

  • Status changed from New to Resolved
  • Target version set to 0.9.0
  • Resolution set to Fixed

Committed in r2659.
Default scope is 'my.blocks', so you can have:

my:
  blocks:
    block_name: Localized block name

or (if not found):

block_name: Localized block name

#4 Updated by Jean-Philippe Lang about 8 years ago

  • Status changed from Resolved to Closed

#5 Updated by Jedidiah Lira about 6 years ago

  • Assignee deleted (Eric Davis)

SPAM

Also available in: Atom PDF