Merge pull request #2194 from matakuka/issue-2093

Config translations moved to client side (Issue #2093)
This commit is contained in:
Norman Jäckel 2016-06-16 10:25:52 +02:00 committed by GitHub
commit 5be8499bb4
10 changed files with 328 additions and 207 deletions

View File

@ -2,8 +2,6 @@ from datetime import datetime
from django.core.exceptions import ValidationError as DjangoValidationError from django.core.exceptions import ValidationError as DjangoValidationError
from django.core.validators import MaxLengthValidator, MinValueValidator from django.core.validators import MaxLengthValidator, MinValueValidator
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy
from openslides.core.config import ConfigVariable from openslides.core.config import ConfigVariable
@ -12,7 +10,7 @@ def validate_start_time(value):
try: try:
datetime.strptime(value, '%d.%m.%Y %H:%M') datetime.strptime(value, '%d.%m.%Y %H:%M')
except ValueError: except ValueError:
raise DjangoValidationError(_('Invalid input.')) raise DjangoValidationError('Invalid input.')
def get_config_variables(): def get_config_variables():
@ -24,34 +22,34 @@ def get_config_variables():
yield ConfigVariable( yield ConfigVariable(
name='agenda_number_prefix', name='agenda_number_prefix',
default_value='', default_value='',
label=ugettext_lazy('Numbering prefix for agenda items'), label='Numbering prefix for agenda items',
help_text=ugettext_lazy('This prefix will be set if you run the automatic agenda numbering.'), help_text='This prefix will be set if you run the automatic agenda numbering.',
weight=210, weight=210,
group=ugettext_lazy('Agenda'), group='Agenda',
subgroup=ugettext_lazy('General'), subgroup='General',
validators=(MaxLengthValidator(20),)) validators=(MaxLengthValidator(20),))
yield ConfigVariable( yield ConfigVariable(
name='agenda_numeral_system', name='agenda_numeral_system',
default_value='arabic', default_value='arabic',
input_type='choice', input_type='choice',
label=ugettext_lazy('Numeral system for agenda items'), label='Numeral system for agenda items',
choices=( choices=(
{'value': 'arabic', 'display_name': ugettext_lazy('Arabic')}, {'value': 'arabic', 'display_name': 'Arabic'},
{'value': 'roman', 'display_name': ugettext_lazy('Roman')}), {'value': 'roman', 'display_name': 'Roman'}),
weight=215, weight=215,
group=ugettext_lazy('Agenda'), group='Agenda',
subgroup=ugettext_lazy('General')) subgroup='General')
# TODO: Use an input type with generic datetime support. # TODO: Use an input type with generic datetime support.
yield ConfigVariable( yield ConfigVariable(
name='agenda_start_event_date_time', name='agenda_start_event_date_time',
default_value='', default_value='',
label=ugettext_lazy('Begin of event'), label='Begin of event',
help_text=ugettext_lazy('Input format: DD.MM.YYYY HH:MM'), help_text='Input format: DD.MM.YYYY HH:MM',
weight=220, weight=220,
group=ugettext_lazy('Agenda'), group='Agenda',
subgroup=ugettext_lazy('General'), subgroup='General',
validators=(validate_start_time,)) validators=(validate_start_time,))
# List of speakers # List of speakers
@ -60,29 +58,29 @@ def get_config_variables():
name='agenda_show_last_speakers', name='agenda_show_last_speakers',
default_value=1, default_value=1,
input_type='integer', input_type='integer',
label=ugettext_lazy('Number of last speakers to be shown on the projector'), label='Number of last speakers to be shown on the projector',
weight=230, weight=230,
group=ugettext_lazy('Agenda'), group='Agenda',
subgroup=ugettext_lazy('List of speakers'), subgroup='List of speakers',
validators=(MinValueValidator(0),)) validators=(MinValueValidator(0),))
yield ConfigVariable( yield ConfigVariable(
name='agenda_countdown_warning_time', name='agenda_countdown_warning_time',
default_value=0, default_value=0,
input_type='integer', input_type='integer',
label=ugettext_lazy('Show orange countdown in the last x seconds of speaking time'), label='Show orange countdown in the last x seconds of speaking time',
help_text=ugettext_lazy('Enter duration in seconds. Choose 0 to disable warning color.'), help_text='Enter duration in seconds. Choose 0 to disable warning color.',
weight=235, weight=235,
group=ugettext_lazy('Agenda'), group='Agenda',
subgroup=ugettext_lazy('List of speakers'), subgroup='List of speakers',
validators=(MinValueValidator(0),)) validators=(MinValueValidator(0),))
yield ConfigVariable( yield ConfigVariable(
name='agenda_couple_countdown_and_speakers', name='agenda_couple_countdown_and_speakers',
default_value=False, default_value=False,
input_type='boolean', input_type='boolean',
label=ugettext_lazy('Couple countdown with the list of speakers'), label='Couple countdown with the list of speakers',
help_text=ugettext_lazy('[Begin speech] starts the countdown, [End speech] stops the countdown.'), help_text='[Begin speech] starts the countdown, [End speech] stops the countdown.',
weight=240, weight=240,
group=ugettext_lazy('Agenda'), group='Agenda',
subgroup=ugettext_lazy('List of speakers')) subgroup='List of speakers')

View File

@ -524,6 +524,29 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
element.target = '_blank'; element.target = '_blank';
}; };
} }
]); ])
//mark all agenda config strings for translation with Javascript
.config([
'gettext',
function (gettext) {
gettext('Numbering prefix for agenda items');
gettext('This prefix will be set if you run the automatic agenda numbering.');
gettext('Agenda');
gettext('Invalid input.');
gettext('Numeral system for agenda items');
gettext('Arabic');
gettext('Roman');
gettext('Begin of event');
gettext('Input format: DD.MM.YYYY HH:MM');
gettext('Number of last speakers to be shown on the projector');
gettext('List of speakers');
gettext('Show orange countdown in the last x seconds of speaking time');
gettext('Enter duration in seconds. Choose 0 to disable warning color.');
gettext('Couple countdown with the list of speakers');
gettext('[Begin speech] starts the countdown, [End speech] stops the' +
' countdown.');
}
]);
}()); }());

View File

@ -1,6 +1,4 @@
from django.core.validators import MinValueValidator from django.core.validators import MinValueValidator
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy
from openslides.core.config import ConfigVariable from openslides.core.config import ConfigVariable
from openslides.poll.models import PERCENT_BASE_CHOICES from openslides.poll.models import PERCENT_BASE_CHOICES
@ -18,74 +16,74 @@ def get_config_variables():
name='assignments_poll_vote_values', name='assignments_poll_vote_values',
default_value='auto', default_value='auto',
input_type='choice', input_type='choice',
label=ugettext_lazy('Election method'), label='Election method',
choices=( choices=(
{'value': 'auto', 'display_name': ugettext_lazy('Automatic assign of method')}, {'value': 'auto', 'display_name': 'Automatic assign of method'},
{'value': 'votes', 'display_name': ugettext_lazy('Always one option per candidate')}, {'value': 'votes', 'display_name': 'Always one option per candidate'},
{'value': 'yesnoabstain', 'display_name': ugettext_lazy('Always Yes-No-Abstain per candidate')}, {'value': 'yesnoabstain', 'display_name': 'Always Yes-No-Abstain per candidate'},
{'value': 'yesno', 'display_name': ugettext_lazy('Always Yes/No per candidate')}), {'value': 'yesno', 'display_name': 'Always Yes/No per candidate'}),
weight=410, weight=410,
group=ugettext_lazy('Elections'), group='Elections',
subgroup=ugettext_lazy('Ballot and ballot papers')) subgroup='Ballot and ballot papers')
yield ConfigVariable( yield ConfigVariable(
name='assignments_poll_100_percent_base', name='assignments_poll_100_percent_base',
default_value='WITHOUT_INVALID', default_value='WITHOUT_INVALID',
input_type='choice', input_type='choice',
label=ugettext_lazy('The 100 % base of an election result consists of'), label='The 100 % base of an election result consists of',
choices=PERCENT_BASE_CHOICES, choices=PERCENT_BASE_CHOICES,
weight=420, weight=420,
group=ugettext_lazy('Elections'), group='Elections',
subgroup=ugettext_lazy('Ballot and ballot papers')) subgroup='Ballot and ballot papers')
yield ConfigVariable( yield ConfigVariable(
name='assignments_pdf_ballot_papers_selection', name='assignments_pdf_ballot_papers_selection',
default_value='CUSTOM_NUMBER', default_value='CUSTOM_NUMBER',
input_type='choice', input_type='choice',
label=ugettext_lazy('Number of ballot papers (selection)'), label='Number of ballot papers (selection)',
choices=( choices=(
{'value': 'NUMBER_OF_DELEGATES', 'display_name': ugettext_lazy('Number of all delegates')}, {'value': 'NUMBER_OF_DELEGATES', 'display_name': 'Number of all delegates'},
{'value': 'NUMBER_OF_ALL_PARTICIPANTS', 'display_name': ugettext_lazy('Number of all participants')}, {'value': 'NUMBER_OF_ALL_PARTICIPANTS', 'display_name': 'Number of all participants'},
{'value': 'CUSTOM_NUMBER', 'display_name': ugettext_lazy('Use the following custom number')}), {'value': 'CUSTOM_NUMBER', 'display_name': 'Use the following custom number'}),
weight=430, weight=430,
group=ugettext_lazy('Elections'), group='Elections',
subgroup=ugettext_lazy('Ballot and ballot papers')) subgroup='Ballot and ballot papers')
yield ConfigVariable( yield ConfigVariable(
name='assignments_pdf_ballot_papers_number', name='assignments_pdf_ballot_papers_number',
default_value=8, default_value=8,
input_type='integer', input_type='integer',
label=ugettext_lazy('Custom number of ballot papers'), label='Custom number of ballot papers',
weight=440, weight=440,
group=ugettext_lazy('Elections'), group='Elections',
subgroup=ugettext_lazy('Ballot and ballot papers'), subgroup='Ballot and ballot papers',
validators=(MinValueValidator(1),)) validators=(MinValueValidator(1),))
yield ConfigVariable( yield ConfigVariable(
name='assignments_publish_winner_results_only', name='assignments_publish_winner_results_only',
default_value=False, default_value=False,
input_type='boolean', input_type='boolean',
label=ugettext_lazy('Publish election result for elected candidates only ' label='Publish election result for elected candidates only '
'(projector view)'), '(projector view)',
weight=450, weight=450,
group=ugettext_lazy('Elections'), group='Elections',
subgroup=ugettext_lazy('Ballot and ballot papers')) subgroup='Ballot and ballot papers')
# PDF # PDF
yield ConfigVariable( yield ConfigVariable(
name='assignments_pdf_title', name='assignments_pdf_title',
default_value=_('Elections'), default_value='Elections',
label=ugettext_lazy('Title for PDF document (all elections)'), label='Title for PDF document (all elections)',
weight=460, weight=460,
group=ugettext_lazy('Elections'), group='Elections',
subgroup=ugettext_lazy('PDF'), subgroup='PDF',
translatable=True) translatable=True)
yield ConfigVariable( yield ConfigVariable(
name='assignments_pdf_preamble', name='assignments_pdf_preamble',
default_value='', default_value='',
label=ugettext_lazy('Preamble text for PDF document (all elections)'), label='Preamble text for PDF document (all elections)',
weight=470, weight=470,
group=ugettext_lazy('Elections'), group='Elections',
subgroup=ugettext_lazy('PDF')) subgroup='PDF')

View File

@ -691,6 +691,30 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
}); });
}; };
} }
])
//mark all assignment config strings for translation with Javascript
.config([
'gettext',
function (gettext) {
gettext('Election method');
gettext('Automatic assign of method');
gettext('Always one option per candidate');
gettext('Always Yes-No-Abstain per candidate');
gettext('Always Yes/No per candidate');
gettext('Elections');
gettext('Ballot and ballot papers');
gettext('The 100 % base of an election result consists of');
gettext('Number of ballot papers (selection)');
gettext('Number of all delegates');
gettext('Number of all participants');
gettext('Use the following custom number');
gettext('Custom number of ballot papers');
gettext('Publish election result for elected candidates only (' +
'projector view)');
gettext('Title for PDF document (all elections)');
gettext('Preamble text for PDF document (all elections)');
}
]); ]);
}()); }());

View File

@ -1,7 +1,4 @@
from django.core.validators import MaxLengthValidator from django.core.validators import MaxLengthValidator
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy
from openslides.core.config import ConfigVariable from openslides.core.config import ConfigVariable
@ -16,76 +13,76 @@ def get_config_variables():
yield ConfigVariable( yield ConfigVariable(
name='general_event_name', name='general_event_name',
default_value='OpenSlides', default_value='OpenSlides',
label=ugettext_lazy('Event name'), label='Event name',
weight=110, weight=110,
group=ugettext_lazy('General'), group='General',
subgroup=ugettext_lazy('Event'), subgroup='Event',
validators=(MaxLengthValidator(50),)) validators=(MaxLengthValidator(50),))
yield ConfigVariable( yield ConfigVariable(
name='general_event_description', name='general_event_description',
default_value=_('Presentation and assembly system'), default_value='Presentation and assembly system',
label=ugettext_lazy('Short description of event'), label='Short description of event',
weight=115, weight=115,
group=ugettext_lazy('General'), group='General',
subgroup=ugettext_lazy('Event'), subgroup='Event',
validators=(MaxLengthValidator(100),), validators=(MaxLengthValidator(100),),
translatable=True) translatable=True)
yield ConfigVariable( yield ConfigVariable(
name='general_event_date', name='general_event_date',
default_value='', default_value='',
label=ugettext_lazy('Event date'), label='Event date',
weight=120, weight=120,
group=ugettext_lazy('General'), group='General',
subgroup=ugettext_lazy('Event')) subgroup='Event')
yield ConfigVariable( yield ConfigVariable(
name='general_event_location', name='general_event_location',
default_value='', default_value='',
label=ugettext_lazy('Event location'), label='Event location',
weight=125, weight=125,
group=ugettext_lazy('General'), group='General',
subgroup=ugettext_lazy('Event')) subgroup='Event')
yield ConfigVariable( yield ConfigVariable(
name='general_event_organizer', name='general_event_organizer',
default_value='', default_value='',
label=ugettext_lazy('Event organizer'), label='Event organizer',
weight=130, weight=130,
group=ugettext_lazy('General'), group='General',
subgroup=ugettext_lazy('Event')) subgroup='Event')
yield ConfigVariable( yield ConfigVariable(
name='general_event_legal_notice', name='general_event_legal_notice',
default_value=_( default_value='<a href="http://www.openslides.org">OpenSlides</a> is a '
'<a href="http://www.openslides.org">OpenSlides</a> is a free web based ' 'free web based presentation and assembly system for '
'presentation and assembly system for visualizing and controlling agenda, ' 'visualizing and controlling agenda, motions and '
'motions and elections of an assembly.'), 'elections of an assembly.',
input_type='text', input_type='text',
label=ugettext_lazy('Legal notice'), label='Legal notice',
weight=132, weight=132,
group=ugettext_lazy('General'), group='General',
subgroup=ugettext_lazy('Event'), subgroup='Event',
translatable=True) translatable=True)
yield ConfigVariable( yield ConfigVariable(
name='general_event_welcome_title', name='general_event_welcome_title',
default_value=_('Welcome to OpenSlides'), default_value='Welcome to OpenSlides',
label=ugettext_lazy('Front page title'), label='Front page title',
weight=134, weight=134,
group=ugettext_lazy('General'), group='General',
subgroup=ugettext_lazy('Event'), subgroup='Event',
translatable=True) translatable=True)
yield ConfigVariable( yield ConfigVariable(
name='general_event_welcome_text', name='general_event_welcome_text',
default_value=_('[Space for your welcome text.]'), default_value='[Space for your welcome text.]',
input_type='text', input_type='text',
label=ugettext_lazy('Front page text'), label='Front page text',
weight=136, weight=136,
group=ugettext_lazy('General'), group='General',
subgroup=ugettext_lazy('Event'), subgroup='Event',
translatable=True) translatable=True)
# General System # General System
@ -94,18 +91,18 @@ def get_config_variables():
name='general_system_enable_anonymous', name='general_system_enable_anonymous',
default_value=False, default_value=False,
input_type='boolean', input_type='boolean',
label=ugettext_lazy('Allow access for anonymous guest users'), label='Allow access for anonymous guest users',
weight=138, weight=138,
group=ugettext_lazy('General'), group='General',
subgroup=ugettext_lazy('System')) subgroup='System')
yield ConfigVariable( yield ConfigVariable(
name='general_login_info_text', name='general_login_info_text',
default_value='', default_value='',
label=ugettext_lazy('Show this text on the login page.'), label='Show this text on the login page.',
weight=140, weight=140,
group=ugettext_lazy('General'), group='General',
subgroup=ugettext_lazy('System')) subgroup='System')
# Projector # Projector
@ -113,48 +110,47 @@ def get_config_variables():
name='projector_enable_logo', name='projector_enable_logo',
default_value=True, default_value=True,
input_type='boolean', input_type='boolean',
label=ugettext_lazy('Show logo on projector'), label='Show logo on projector',
help_text=ugettext_lazy( help_text='You can replace the logo. Just copy a file to '
'You can replace the logo. Just copy a file to ' '"static/img/logo-projector.png" in your OpenSlides data path.',
'"static/img/logo-projector.png" in your OpenSlides data path.'),
weight=150, weight=150,
group=ugettext_lazy('Projector')) group='Projector')
yield ConfigVariable( yield ConfigVariable(
name='projector_enable_title', name='projector_enable_title',
default_value=True, default_value=True,
input_type='boolean', input_type='boolean',
label=ugettext_lazy('Show title and description of event on projector'), label='Show title and description of event on projector',
weight=155, weight=155,
group=ugettext_lazy('Projector')) group='Projector')
yield ConfigVariable( yield ConfigVariable(
name='projector_header_backgroundcolor', name='projector_header_backgroundcolor',
default_value='#317796', default_value='#317796',
input_type='colorpicker', input_type='colorpicker',
label=ugettext_lazy('Background color of projector header and footer'), label='Background color of projector header and footer',
weight=160, weight=160,
group=ugettext_lazy('Projector')) group='Projector')
yield ConfigVariable( yield ConfigVariable(
name='projector_header_fontcolor', name='projector_header_fontcolor',
default_value='#F5F5F5', default_value='#F5F5F5',
input_type='colorpicker', input_type='colorpicker',
label=ugettext_lazy('Font color of projector header and footer'), label='Font color of projector header and footer',
weight=165, weight=165,
group=ugettext_lazy('Projector')) group='Projector')
yield ConfigVariable( yield ConfigVariable(
name='projector_h1_fontcolor', name='projector_h1_fontcolor',
default_value='#317796', default_value='#317796',
input_type='colorpicker', input_type='colorpicker',
label=ugettext_lazy('Font color of projector headline'), label='Font color of projector headline',
weight=170, weight=170,
group=ugettext_lazy('Projector')) group='Projector')
yield ConfigVariable( yield ConfigVariable(
name='projector_default_countdown', name='projector_default_countdown',
default_value=60, default_value=60,
label=ugettext_lazy('Default countdown'), label='Default countdown',
weight=185, weight=185,
group=ugettext_lazy('Projector')) group='Projector')

View File

@ -1111,6 +1111,40 @@ angular.module('OpenSlidesApp.core.site', [
} }
}; };
} }
])
//Mark all core config strings for translation in Javascript
.config([
'gettext',
function (gettext) {
gettext('Presentation and assembly system');
gettext('Event name');
gettext('<a href="http://www.openslides.org">OpenSlides</a> is a free' +
' web based presentation and assembly system for visualizing' +
' and controlling agenda, motions and elections of an' +
' assembly.');
gettext('General');
gettext('Event');
gettext('Short description of Event');
gettext('Event date');
gettext('Event location');
gettext('Event organizer');
gettext('Legal notice');
gettext('Front page title');
gettext('Front page text');
gettext('Allow access for anonymous guest users');
gettext('Show this text on the login page.');
gettext('Show logo on projector');
gettext('You can replace the logo. Just copy a file to ');
gettext('"static/img/logo-projector.png" in your OpenSlides data' +
' path.');
gettext('Projector');
gettext('Show title and description of event on projector');
gettext('Backgroundcolor of projector header and footer');
gettext('Font color of projector header and footer');
gettext('Font color of projector headline');
gettext('Default countdown');
}
]); ]);
}()); }());

View File

@ -1,6 +1,4 @@
from django.core.validators import MinValueValidator from django.core.validators import MinValueValidator
from django.utils.translation import ugettext as _
from django.utils.translation import pgettext, ugettext_lazy
from openslides.core.config import ConfigVariable from openslides.core.config import ConfigVariable
from openslides.poll.models import PERCENT_BASE_CHOICES from openslides.poll.models import PERCENT_BASE_CHOICES
@ -13,7 +11,7 @@ def get_workflow_choices():
Returns a list of all workflows to be used as choices for the config variable Returns a list of all workflows to be used as choices for the config variable
'motions_workflow'. Each list item contains the pk and the display name. 'motions_workflow'. Each list item contains the pk and the display name.
""" """
return [{'value': str(workflow.pk), 'display_name': ugettext_lazy(workflow.name)} return [{'value': str(workflow.pk), 'display_name': workflow.name}
for workflow in Workflow.objects.all()] for workflow in Workflow.objects.all()]
@ -30,51 +28,51 @@ def get_config_variables():
name='motions_workflow', name='motions_workflow',
default_value='1', default_value='1',
input_type='choice', input_type='choice',
label=ugettext_lazy('Workflow of new motions'), label='Workflow of new motions',
choices=get_workflow_choices, choices=get_workflow_choices,
weight=310, weight=310,
group=ugettext_lazy('Motions'), group='Motions',
subgroup=ugettext_lazy('General')) subgroup='General')
yield ConfigVariable( yield ConfigVariable(
name='motions_identifier', name='motions_identifier',
default_value='per_category', default_value='per_category',
input_type='choice', input_type='choice',
label=ugettext_lazy('Identifier'), label='Identifier',
choices=( choices=(
{'value': 'per_category', 'display_name': ugettext_lazy('Numbered per category')}, {'value': 'per_category', 'display_name': 'Numbered per category'},
{'value': 'serially_numbered', 'display_name': ugettext_lazy('Serially numbered')}, {'value': 'serially_numbered', 'display_name': 'Serially numbered'},
{'value': 'manually', 'display_name': ugettext_lazy('Set it manually')}), {'value': 'manually', 'display_name': 'Set it manually'}),
weight=315, weight=315,
group=ugettext_lazy('Motions'), group='Motions',
subgroup=ugettext_lazy('General')) subgroup='General')
yield ConfigVariable( yield ConfigVariable(
name='motions_preamble', name='motions_preamble',
default_value=_('The assembly may decide,'), default_value='The assembly may decide,',
label=ugettext_lazy('Motion preamble'), label='Motion preamble',
weight=320, weight=320,
group=ugettext_lazy('Motions'), group='Motions',
subgroup=ugettext_lazy('General'), subgroup='General',
translatable=True) translatable=True)
yield ConfigVariable( yield ConfigVariable(
name='motions_stop_submitting', name='motions_stop_submitting',
default_value=False, default_value=False,
input_type='boolean', input_type='boolean',
label=ugettext_lazy('Stop submitting new motions by non-staff users'), label='Stop submitting new motions by non-staff users',
weight=325, weight=325,
group=ugettext_lazy('Motions'), group='Motions',
subgroup=ugettext_lazy('General')) subgroup='General')
yield ConfigVariable( yield ConfigVariable(
name='motions_allow_disable_versioning', name='motions_allow_disable_versioning',
default_value=False, default_value=False,
input_type='boolean', input_type='boolean',
label=ugettext_lazy('Allow to disable versioning'), label='Allow to disable versioning',
weight=330, weight=330,
group=ugettext_lazy('Motions'), group='Motions',
subgroup=ugettext_lazy('General')) subgroup='General')
# Amendments # Amendments
# Amendments currently not implemented. (TODO: Implement it like in OpenSlides 1.7.) # Amendments currently not implemented. (TODO: Implement it like in OpenSlides 1.7.)
@ -82,20 +80,20 @@ def get_config_variables():
name='motions_amendments_enabled', name='motions_amendments_enabled',
default_value=False, default_value=False,
input_type='boolean', input_type='boolean',
label=ugettext_lazy('Activate amendments'), label='Activate amendments',
hidden=True, hidden=True,
weight=335, weight=335,
group=ugettext_lazy('Motions'), group='Motions',
subgroup=ugettext_lazy('Amendments')) subgroup='Amendments')
yield ConfigVariable( yield ConfigVariable(
name='motions_amendments_prefix', name='motions_amendments_prefix',
default_value=pgettext('Prefix for the identifier for amendments', 'A'), default_value='A',
label=ugettext_lazy('Prefix for the identifier for amendments'), label='Prefix for the identifier for amendments',
hidden=True, hidden=True,
weight=340, weight=340,
group=ugettext_lazy('Motions'), group='Motions',
subgroup=ugettext_lazy('Amendments')) subgroup='Amendments')
# Supporters # Supporters
@ -103,21 +101,21 @@ def get_config_variables():
name='motions_min_supporters', name='motions_min_supporters',
default_value=0, default_value=0,
input_type='integer', input_type='integer',
label=ugettext_lazy('Number of (minimum) required supporters for a motion'), label='Number of (minimum) required supporters for a motion',
help_text=ugettext_lazy('Choose 0 to disable the supporting system.'), help_text='Choose 0 to disable the supporting system.',
weight=345, weight=345,
group=ugettext_lazy('Motions'), group='Motions',
subgroup=ugettext_lazy('Supporters'), subgroup='Supporters',
validators=(MinValueValidator(0),)) validators=(MinValueValidator(0),))
yield ConfigVariable( yield ConfigVariable(
name='motions_remove_supporters', name='motions_remove_supporters',
default_value=False, default_value=False,
input_type='boolean', input_type='boolean',
label=ugettext_lazy('Remove all supporters of a motion if a submitter edits his motion in early state'), label='Remove all supporters of a motion if a submitter edits his motion in early state',
weight=350, weight=350,
group=ugettext_lazy('Motions'), group='Motions',
subgroup=ugettext_lazy('Supporters')) subgroup='Supporters')
# Voting and ballot papers # Voting and ballot papers
@ -125,59 +123,59 @@ def get_config_variables():
name='motions_poll_100_percent_base', name='motions_poll_100_percent_base',
default_value='WITHOUT_INVALID', default_value='WITHOUT_INVALID',
input_type='choice', input_type='choice',
label=ugettext_lazy('The 100 % base of a voting result consists of'), label='The 100 % base of a voting result consists of',
choices=PERCENT_BASE_CHOICES, choices=PERCENT_BASE_CHOICES,
weight=355, weight=355,
group=ugettext_lazy('Motions'), group='Motions',
subgroup=ugettext_lazy('Voting and ballot papers')) subgroup='Voting and ballot papers')
yield ConfigVariable( yield ConfigVariable(
name='motions_pdf_ballot_papers_selection', name='motions_pdf_ballot_papers_selection',
default_value='CUSTOM_NUMBER', default_value='CUSTOM_NUMBER',
input_type='choice', input_type='choice',
label=ugettext_lazy('Number of ballot papers (selection)'), label='Number of ballot papers (selection)',
choices=( choices=(
{'value': 'NUMBER_OF_DELEGATES', 'display_name': ugettext_lazy('Number of all delegates')}, {'value': 'NUMBER_OF_DELEGATES', 'display_name': 'Number of all delegates'},
{'value': 'NUMBER_OF_ALL_PARTICIPANTS', 'display_name': ugettext_lazy('Number of all participants')}, {'value': 'NUMBER_OF_ALL_PARTICIPANTS', 'display_name': 'Number of all participants'},
{'value': 'CUSTOM_NUMBER', 'display_name': ugettext_lazy('Use the following custom number')}), {'value': 'CUSTOM_NUMBER', 'display_name': 'Use the following custom number'}),
weight=360, weight=360,
group=ugettext_lazy('Motions'), group='Motions',
subgroup=ugettext_lazy('Voting and ballot papers')) subgroup='Voting and ballot papers')
yield ConfigVariable( yield ConfigVariable(
name='motions_pdf_ballot_papers_number', name='motions_pdf_ballot_papers_number',
default_value=8, default_value=8,
input_type='integer', input_type='integer',
label=ugettext_lazy('Custom number of ballot papers'), label='Custom number of ballot papers',
weight=365, weight=365,
group=ugettext_lazy('Motions'), group='Motions',
subgroup=ugettext_lazy('Voting and ballot papers'), subgroup='Voting and ballot papers',
validators=(MinValueValidator(1),)) validators=(MinValueValidator(1),))
# PDF # PDF
yield ConfigVariable( yield ConfigVariable(
name='motions_pdf_title', name='motions_pdf_title',
default_value=_('Motions'), default_value='Motions',
label=ugettext_lazy('Title for PDF document (all motions)'), label='Title for PDF document (all motions)',
weight=370, weight=370,
group=ugettext_lazy('Motions'), group='Motions',
subgroup=ugettext_lazy('PDF'), subgroup='PDF',
translatable=True) translatable=True)
yield ConfigVariable( yield ConfigVariable(
name='motions_pdf_preamble', name='motions_pdf_preamble',
default_value='', default_value='',
label=ugettext_lazy('Preamble text for PDF document (all motions)'), label='Preamble text for PDF document (all motions)',
weight=375, weight=375,
group=ugettext_lazy('Motions'), group='Motions',
subgroup=ugettext_lazy('PDF')) subgroup='PDF')
yield ConfigVariable( yield ConfigVariable(
name='motions_pdf_paragraph_numbering', name='motions_pdf_paragraph_numbering',
default_value=False, default_value=False,
input_type='boolean', input_type='boolean',
label=ugettext_lazy('Show paragraph numbering (only in PDF)'), label='Show paragraph numbering (only in PDF)',
weight=380, weight=380,
group=ugettext_lazy('Motions'), group='Motions',
subgroup=ugettext_lazy('PDF')) subgroup='PDF')

View File

@ -1051,6 +1051,36 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
); );
}; };
} }
])
//mark all motions config strings for translation in javascript
.config([
'gettext',
function (gettext) {
gettext('The assembly may decide,');
gettext('Workflow of new motions');
gettext('Motions');
gettext('Identifier');
gettext('Numbered per category');
gettext('Serially numbered');
gettext('Set it manually');
gettext('Motion preamble');
gettext('Stop submitting new motions by non-staff users');
gettext('Allow to disable versioning');
gettext('Activate amendments');
gettext('Amendments');
gettext('Prefix for the identifier for amendments');
gettext('Number of (minimum) required supporters for a motion');
gettext('Choose 0 to disable the supporting system.');
gettext('Supporters');
gettext('Remove all supporters of a motion if a submitter edits his' +
' motion in early state');
gettext('Title for PDF document (all motions)');
gettext('Preamble text for PDF document (all motioqns)');
gettext('Show paragraph numbering (only in PDF)');
/// Prefix for the identifier for amendments
gettext('A');
}
]); ]);
}()); }());

View File

@ -1,6 +1,3 @@
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy
from openslides.core.config import ConfigVariable from openslides.core.config import ConfigVariable
@ -16,71 +13,71 @@ def get_config_variables():
name='users_sort_users_by_first_name', name='users_sort_users_by_first_name',
default_value=False, default_value=False,
input_type='boolean', input_type='boolean',
label=ugettext_lazy('Sort users by first name'), label='Sort users by first name',
help_text=ugettext_lazy('Disable for sorting by last name'), help_text='Disable for sorting by last name',
weight=510, weight=510,
group=ugettext_lazy('Users'), group='Users',
subgroup=ugettext_lazy('Sorting')) subgroup='Sorting')
# PDF # PDF
yield ConfigVariable( yield ConfigVariable(
name='users_pdf_welcometitle', name='users_pdf_welcometitle',
default_value=_('Welcome to OpenSlides!'), default_value='Welcome to OpenSlides!',
label=ugettext_lazy('Title for access data and welcome PDF'), label='Title for access data and welcome PDF',
weight=520, weight=520,
group=ugettext_lazy('Users'), group='Users',
subgroup=ugettext_lazy('PDF'), subgroup='PDF',
translatable=True) translatable=True)
yield ConfigVariable( yield ConfigVariable(
name='users_pdf_welcometext', name='users_pdf_welcometext',
default_value=_('[Place for your welcome and help text.]'), default_value='[Place for your welcome and help text.]',
label=ugettext_lazy('Help text for access data and welcome PDF'), label='Help text for access data and welcome PDF',
weight=530, weight=530,
group=ugettext_lazy('Users'), group='Users',
subgroup=ugettext_lazy('PDF'), subgroup='PDF',
translatable=True) translatable=True)
# TODO: Use Django's URLValidator here. # TODO: Use Django's URLValidator here.
yield ConfigVariable( yield ConfigVariable(
name='users_pdf_url', name='users_pdf_url',
default_value='http://example.com:8000', default_value='http://example.com:8000',
label=ugettext_lazy('System URL'), label='System URL',
help_text=ugettext_lazy('Used for QRCode in PDF of access data.'), help_text='Used for QRCode in PDF of access data.',
weight=540, weight=540,
group=ugettext_lazy('Users'), group='Users',
subgroup=ugettext_lazy('PDF')) subgroup='PDF')
yield ConfigVariable( yield ConfigVariable(
name='users_pdf_wlan_ssid', name='users_pdf_wlan_ssid',
default_value='', default_value='',
label=ugettext_lazy('WLAN name (SSID)'), label='WLAN name (SSID)',
help_text=ugettext_lazy('Used for WLAN QRCode in PDF of access data.'), help_text='Used for WLAN QRCode in PDF of access data.',
weight=550, weight=550,
group=ugettext_lazy('Users'), group='Users',
subgroup=ugettext_lazy('PDF')) subgroup='PDF')
yield ConfigVariable( yield ConfigVariable(
name='users_pdf_wlan_password', name='users_pdf_wlan_password',
default_value='', default_value='',
label=ugettext_lazy('WLAN password'), label='WLAN password',
help_text=ugettext_lazy('Used for WLAN QRCode in PDF of access data.'), help_text='Used for WLAN QRCode in PDF of access data.',
weight=560, weight=560,
group=ugettext_lazy('Users'), group='Users',
subgroup=ugettext_lazy('PDF')) subgroup='PDF')
yield ConfigVariable( yield ConfigVariable(
name='users_pdf_wlan_encryption', name='users_pdf_wlan_encryption',
default_value='', default_value='',
input_type='choice', input_type='choice',
label=ugettext_lazy('WLAN encryption'), label='WLAN encryption',
help_text=ugettext_lazy('Used for WLAN QRCode in PDF of access data.'), help_text='Used for WLAN QRCode in PDF of access data.',
choices=( choices=(
{'value': '', 'display_name': '---------'}, {'value': '', 'display_name': '---------'},
{'value': 'WEP', 'display_name': ugettext_lazy('WEP')}, {'value': 'WEP', 'display_name': 'WEP'},
{'value': 'WPA', 'display_name': ugettext_lazy('WPA/WPA2')}, {'value': 'WPA', 'display_name': 'WPA/WPA2'},
{'value': 'nopass', 'display_name': ugettext_lazy('No encryption')}), {'value': 'nopass', 'display_name': 'No encryption'}),
weight=570, weight=570,
group=ugettext_lazy('Users'), group='Users',
subgroup=ugettext_lazy('PDF')) subgroup='PDF')

View File

@ -998,6 +998,29 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
gettext('Can see names of users'); gettext('Can see names of users');
gettext('Can see extra data of users (e.g. present and comment)'); gettext('Can see extra data of users (e.g. present and comment)');
gettext('Can manage users'); gettext('Can manage users');
//mark all config strings in users/config_variables.py for translation
gettext('Welcome to OpenSlides');
gettext('Space for your welcome text.]');
gettext('[Place for your welcome and help text.]');
gettext('Sort users by first name');
gettext('Disable for sorting by last name');
gettext('Users');
gettext('Sorting');
gettext('Welcome to OpenSlides!');
gettext('Title for access data and welcome PDF');
gettext('PDF');
gettext('Help text for access data and welcome PDF');
gettext('System URL');
gettext('Used for QRCode in PDF of access data.');
gettext('WLAN name (SSID)');
gettext('Used for WLAN QRCode in PDF of access data.');
gettext('WLAN password');
gettext('Used for WLAN QRCode in PDF of access data.');
gettext('WLAN encryption');
gettext('Used for WLAN QRCode in PDF of access data.');
gettext('WEP');
gettext('WPA/WPA2');
gettext('No encryption');
} }
]); ]);