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

Adds translation items to project/indicator selector #349

Merged
merged 3 commits into from
Aug 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/assets/scripts/components/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const Map = React.createClass({
if (category) {
switch (category.toLowerCase()) {
case 'sequential':
domain = values.map(d => +d.value);
domain = values.filter(d => !isNaN(d.value)).map(d => +d.value);
scale = scaleQuantile().domain(domain).range(SEQUENTIAL.slice(0, 5));
break;

Expand Down
26 changes: 15 additions & 11 deletions app/assets/scripts/views/project-browse.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,16 @@ var ProjectBrowse = React.createClass({

const indicatorTheme = activeIndicatorTheme || themeNames[0];
const availableIndicators = get(themes, indicatorTheme, []);
const t = get(window.t, [lang, 'projects_indicators'], {});
return (
<section className='modal modal--large'>
<div className='modal__inner modal__indicators'>
<button className='modal__button-dismiss' title='close' onClick={this.closeModal}></button>
<h1 className='inpage__title heading--deco heading--medium'>Add {this.state.activeIndicatorType.toUpperCase()} Indicators</h1>
<div className='modal__instructions'><p>Add and compare development indicators listed below.</p></div>
<h1 className='inpage__title heading--deco heading--medium'>{t.add} {this.state.activeIndicatorType.toUpperCase()} {t.indicators}</h1>
<div className='modal__instructions'><p>{t.compare_indicators}</p></div>

<div className='indicators--selected'>
<span className='heading--label'>Selected Indicators:&nbsp;</span>
<span className='heading--label'>{t.selected_indicators}</span>
{selectedIndicators.map((name) => {
return (
<span className='button--small button--tag'
Expand Down Expand Up @@ -440,20 +441,22 @@ var ProjectBrowse = React.createClass({
<ul className='button--list'>
<li><button
onClick={this.confirmIndicators}
type='button' className='button button--medium button--primary'>Apply</button></li>
type='button' className='button button--medium button--primary'>{t.apply}</button></li>
<li><button
onClick={this.cancelIndicators}
type='button' className='button button--medium button--primary-bounded'>Cancel</button></li>
type='button' className='button button--medium button--primary-bounded'>{t.cancel}</button></li>
</ul>
</div>
</section>
);
},

renderActiveIndicators: function (activeIndicator, activeIndicators) {
const { lang } = this.props.meta;
const t = get(window.t, [lang, 'projects_indicators'], {});
return (
<div className='indicator__overlay'>
<h1 className='heading--label'>Selected Indicator Overlays</h1>
<h1 className='heading--label'>{t.selected_overlays}</h1>
<ul className='indicator__overlay--list'>
{activeIndicators.map((indicator) => (
<li
Expand All @@ -475,11 +478,12 @@ var ProjectBrowse = React.createClass({
let projects = this.props.api.projects;
let { lang } = this.props.meta;
const { selectedProjectFilters } = this.state;
const t = get(window.t, [lang, 'projects_indicators'], {});

return (
<section className='modal modal--large'>
<div className='modal__inner modal__projects'>
<h1 className='inpage__title heading--deco heading--medium'>Add and Filter Projects</h1>
<h1 className='inpage__title heading--deco heading--medium'>{t.add_and_filter}</h1>
<div className='modal__filters'>
<div className='modal__filters--defaults'>
<label className='form__option form__option--custom-checkbox'>
Expand All @@ -490,10 +494,10 @@ var ProjectBrowse = React.createClass({
id='form-checkbox-1'
onChange={this.toggleProjects}
value='All projects' />
<span className='form__option__text'>All Projects</span>
<span className='form__option__text'>{t.all_projects}</span>
<span className='form__option__ui'></span>
</label>
<a onClick={this.resetProjectFilters} className='link--secondary'>reset filters</a>
<a onClick={this.resetProjectFilters} className='link--secondary'>{t.reset_filters}</a>
</div>

{projectFilters.map((filter) => (
Expand Down Expand Up @@ -525,11 +529,11 @@ var ProjectBrowse = React.createClass({
<li><button
onClick={this.confirmFilters}
type='button'
className='button button--medium button--primary'>Apply</button></li>
className='button button--medium button--primary'>{t.apply}</button></li>
<li><button
onClick={this.cancelFilters}
type='button'
className='button button--medium button--primary-bounded'>Cancel</button></li>
className='button button--medium button--primary-bounded'>{t.cancel}</button></li>
</ul>
</div>
<button className='modal__button-dismiss' title='close' onClick={this.closeModal}></button>
Expand Down
32 changes: 21 additions & 11 deletions app/assets/translations/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ homepage:
chart_two_label: 'في الميعاد'
chart_two_label2: 'متأخر'
chart_two_label3: 'ممتد'
chart_title_three: 'ميزانية'
chart_title_three: 'الميزانية'
chart_three_label: 'منحة'
chart_three_label2: 'قرض'
chart_three_label3: 'مساهمة محلية'

total_projects: 'المشروعات مجموع'
total_projects: 'مجموع المشروعات'
in_funding: 'التمويل'
total_donors: 'المانحة مجموع'
donor_collaborations: 'المانحة التعاون'
total_donors: 'مجموع الجهات المانحة'
donor_collaborations: 'التعاون بين المانحين'

other_indicators_title: 'مؤشرات التنمية'
other_indicators_description: 'إضافة ومقارنة مؤشرات التنمية'
Expand All @@ -48,13 +48,23 @@ projects_indicators:
sds_dropdown: 'مؤشرات استراتيجية التنمية المستدامة'
sdg_dropdown: 'مؤشرات أهداف التنمية المُستدامة'
other_dropdown: 'مؤشرات تنمية أخرى'
compare_indicators: 'أضف وقارن مؤشرات التنمية التالية'
selected_indicators: 'المؤشرات المختارة'
add: 'أضف'
indicators: 'المؤشرات'
cancel: 'إلغاء'
apply: 'تطبيق'
add_and_filter: 'إضافة وتصفية المشاريع'
all_projects: 'جميع المشاريع'
reset_filters: 'إعادة التصفية'
selected_overlays: 'المؤشرات المحددة'

projects_list_view:
projects_title: 'المشروعات'
sort_by_title: 'تصنيف'
sort_alphabetical: 'أبجدي'
sort_ascending: النسبة المئوية مكتملة
sort_descending: النسبة المئوية مكتملة
sort_ascending: 'تصاعدي'
sort_descending: 'تنازلي'

project_pages:
print: 'طباعة'
Expand All @@ -69,9 +79,9 @@ project_pages:
categories_title: 'القطاعات الفرعية'
donors_title: 'الجهات المانحة'
recommendations: 'توصيات بناء على خبرة المشروع'
contract_date:'تاريخ توقيه العقد'
budget_title: 'ميزانية'
contract_date: 'تاريخ توقيع العقد'

budget_title: 'الميزانية'
funding_loans_title: 'قرض'
funding_grants_title: 'منحة'
funding_local_title: 'مساهمة محلية'
Expand All @@ -91,13 +101,13 @@ project_pages:
component_title: 'المكون\النشاط'
kpi_title: 'مؤشر الأداء'
target_title: 'الهدف'
rate_title: 'التقدم في التنفيذ'
rate_title: 'التقدم المحرز'
date_title: 'تاريخ الرصد'

project_comparison_title: 'مقارنة المشروعات حسب القطاع الفرعي'
comparison_chart_title1: 'التمويل'
comparison_chart_title2: 'نسبة الانتهاء'
comparision_chart_title3: 'المستفيدون المستهدفون'
comparision_chart_title3: 'المستفيدين المستهدفين'

related_sds_projects_title: ' مشروعات ذات صلة - حسب أهداف استراتيجية التنمية المُستدامة '

Expand Down
10 changes: 10 additions & 0 deletions app/assets/translations/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ projects_indicators:
sds_dropdown: SDS Indicators
sdg_dropdown: SDG Indicators
other_dropdown: Other Indicators
compare_indicators: Add and compare development indicators listed below.
selected_indicators: Selected Indicators
add: Add
indicators: Indicators
cancel: Cancel
apply: Apply
add_and_filter: Add and Filter projects
all_projects: All Projects
reset_filters: reset filters
selected_overlays: Selected Indicator Overlays

projects_list_view:
projects_title: Projects
Expand Down