プロジェクト

全般

プロフィール

Vote #64960

完了

Allow custom my_page blocks to define drop-down names

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Plugin API_20
対象バージョン:
開始日:
2009/03/26
期日:
進捗率:

0%

予定工数:
category_id:
20
version_id:
6
issue_org_id:
3057
author_id:
2928
assigned_to_id:
0
comments:
5
status_id:
5
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

I have "a plugin that adds additional blocks to the my_page page":http://github.com/bradbeattie/redmine-my-widgets-plugin/tree/master. 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.


journals

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?
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
Committed in r2659.
Default scope is 'my.blocks', so you can have:

<pre>
my:
blocks:
block_name: Localized block name
</pre>

or (if not found):

<pre>
block_name: Localized block name
</pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
SPAM
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリPlugin API_20 にセット
  • 対象バージョン0.9.0_6 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0