Skip to content

Commit

Permalink
Replace trans tag with the t function in templates
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed Apr 25, 2024
1 parent b6eda64 commit b1cb1c8
Show file tree
Hide file tree
Showing 199 changed files with 1,931 additions and 1,988 deletions.
26 changes: 13 additions & 13 deletions resources/templates/columns_definitions/column_attributes.twig
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
<input id="field_{{ column_number }}_{{ ci - ci_offset }}" type="text" name="field_length[{{ column_number }}]" size="
{{- length_values_input_size }}" value="{{ length }}" class="textfield">
<p class="enum_notice" id="enum_notice_{{ column_number }}_{{ ci - ci_offset }}">
<a href="#" class="open_enum_editor">{% trans 'Edit ENUM/SET values' %}</a>
<a href="#" class="open_enum_editor">{{ t('Edit ENUM/SET values') }}</a>
</p>
{% set ci = ci + 1 %}
</td>
<td class="text-center">
<select name="field_default_type[{{ column_number }}]" id="field_{{ column_number }}_{{ ci - ci_offset }}" class="default_type">
<option value="NONE"{{ column_meta['DefaultType'] is defined and column_meta['DefaultType'] == 'NONE' ? ' selected' }}>
{% trans %}None{% context %}for default{% endtrans %}
{{ t('None', context = 'for default') }}
</option>
<option value="USER_DEFINED"{{ column_meta['DefaultType'] is defined and column_meta['DefaultType'] == 'USER_DEFINED' ? ' selected' }}>
{% trans 'As defined:' %}
{{ t('As defined:') }}
</option>
<option value="NULL"{{ column_meta['DefaultType'] is defined and column_meta['DefaultType'] == 'NULL' ? ' selected' }}>
NULL
Expand Down Expand Up @@ -99,7 +99,7 @@
<td class="text-center">
<input name="field_adjust_privileges[{{ column_number }}]" id="field_{{ column_number }}_{{ ci - ci_offset }}" type="checkbox" value="NULL" class="allow_null"
{%- if privs_available %} checked>
{%- else %} title="{% trans "You don't have sufficient privileges to perform this operation; Please refer to the documentation for more details" %}" disabled>
{%- else %} title="{{ t("You don't have sufficient privileges to perform this operation; Please refer to the documentation for more details") }}" disabled>
{%- endif %}
{% set ci = ci + 1 %}
</td>
Expand All @@ -109,23 +109,23 @@
<td class="text-center">
<select name="field_key[{{ column_number }}]" id="field_{{ column_number }}_{{ ci - ci_offset }}" data-index="">
<option value="none_{{ column_number }}">---</option>
<option value="primary_{{ column_number }}" title="{% trans "Primary" %}"
<option value="primary_{{ column_number }}" title="{{ t('Primary') }}"
{{- column_meta['Key'] is defined and column_meta['Key'] == 'PRI' ? ' selected' }}>
PRIMARY
</option>
<option value="unique_{{ column_number }}" title="{% trans "Unique" %}"
<option value="unique_{{ column_number }}" title="{{ t('Unique') }}"
{{- column_meta['Key'] is defined and column_meta['Key'] == 'UNI' ? ' selected' }}>
UNIQUE
</option>
<option value="index_{{ column_number }}" title="{% trans "Index" %}"
<option value="index_{{ column_number }}" title="{{ t('Index') }}"
{{- column_meta['Key'] is defined and column_meta['Key'] == 'MUL' ? ' selected' }}>
INDEX
</option>
<option value="fulltext_{{ column_number }}" title="{% trans "Fulltext" %}"
<option value="fulltext_{{ column_number }}" title="{{ t('Fulltext') }}"
{{- column_meta['Key'] is defined and column_meta['Key'] == 'FULLTEXT' ? ' selected' }}>
FULLTEXT
</option>
<option value="spatial_{{ column_number }}" title="{% trans "Spatial" %}"
<option value="spatial_{{ column_number }}" title="{{ t('Spatial') }}"
{{- column_meta['Key'] is defined and column_meta['Key'] == 'SPATIAL' ? ' selected' }}>
SPATIAL
</option>
Expand Down Expand Up @@ -162,7 +162,7 @@
{% if char_editing == 'textarea' %}
<textarea name="field_expression[{{ column_number }}]" cols="15" class="textfield expression">{{ column_meta['Expression'] is defined ? column_meta['Expression'] }}</textarea>
{% else %}
<input type="text" name="field_expression[{{ column_number }}]" size="12" value="{{ column_meta['Expression'] is defined ? column_meta['Expression'] }}" placeholder="{% trans 'Expression' %}" class="textfield expression">
<input type="text" name="field_expression[{{ column_number }}]" size="12" value="{{ column_meta['Expression'] is defined ? column_meta['Expression'] }}" placeholder="{{ t('Expression') }}" class="textfield expression">
{% endif %}
{% set ci = ci + 1 %}
</td>
Expand All @@ -182,7 +182,7 @@
<select id="field_{{ column_number }}_{{ ci - ci_offset }}" name="field_move_to[{{ column_number }}]" size="1" width="5em">
<option value="" selected="selected">&nbsp;</option>
<option value="-first"{{ current_index == 0 ? ' disabled="disabled"' }}>
{% trans 'first' %}
{{ t('first') }}
</option>
{% for move_column in move_columns %}
<option value="{{ move_column.name }}"
Expand Down Expand Up @@ -213,7 +213,7 @@
</td>
<td class="text-center">
<select id="field_{{ column_number }}_{{ ci - ci_offset }}" size="1" name="field_transformation[{{ column_number }}]">
<option value="" title="{% trans 'None' %}"></option>
<option value="" title="{{ t('None') }}"></option>
{% if available_mime['transformation'] is defined and available_mime['transformation'] is iterable %}
{% for mimekey, transform in available_mime['transformation'] %}
{% set parts = transform|split(':') %}
Expand All @@ -236,7 +236,7 @@
</td>
<td class="text-center">
<select id="field_{{ column_number }}_{{ ci - ci_offset }}" size="1" name="field_input_transformation[{{ column_number }}]">
<option value="" title="{% trans 'None' %}"></option>
<option value="" title="{{ t('None') }}"></option>
{% if available_mime['input_transformation'] is defined and available_mime['input_transformation'] is iterable %}
{% for mimekey, transform in available_mime['input_transformation'] %}
{% set parts = transform|split(':') %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div id="table_name_col_no_outer">
<table id="table_name_col_no" class="table table-borderless tdblock">
<tr class="align-middle float-start">
<td>{% trans 'Table name' %}:
<td>{{ t('Table name') }}:
<input type="text"
name="table"
size="40"
Expand All @@ -28,18 +28,18 @@
class="textfield" autofocus required>
</td>
<td>
{% trans 'Add' %}
{{ t('Add') }}
<input type="number"
id="added_fields"
name="added_fields"
size="2"
value="1"
min="1"
onfocus="this.select()">
{% trans 'column(s)' %}
{{ t('column(s)') }}
<input class="btn btn-secondary" type="button"
name="submit_num_fields"
value="{% trans 'Go' %}">
value="{{ t('Go') }}">
</td>
</tr>
</table>
Expand Down Expand Up @@ -68,17 +68,17 @@
<div class="responsivetable">
<table class="table table-borderless w-auto align-middle mb-0">
<tr class="align-top">
<th>{% trans 'Table comments:' %}</th>
<th>{{ t('Table comments:') }}</th>
<td width="25">&nbsp;</td>
<th>{% trans 'Collation:' %}</th>
<th>{{ t('Collation:') }}</th>
<td width="25">&nbsp;</td>
<th>
{% trans 'Storage Engine:' %}
{{ t('Storage Engine:') }}
{{ show_mysql_docu('Storage_engines') }}
</th>
<td width="25">&nbsp;</td>
<th id="storage-engine-connection">
{% trans 'Connection:' %}
{{ t('Connection:') }}
{{ show_mysql_docu('federated-create-connection') }}
</th>
</tr>
Expand Down Expand Up @@ -109,7 +109,7 @@
</td>
<td width="25">&nbsp;</td>
<td>
<select class="form-select" name="tbl_storage_engine" aria-label="{% trans 'Storage engine' %}">
<select class="form-select" name="tbl_storage_engine" aria-label="{{ t('Storage engine') }}">
{% for engine in storage_engines %}
<option value="{{ engine.name }}"{% if engine.comment is not empty %} title="{{ engine.comment }}"{% endif %}
{{- engine.name|lower == tbl_storage_engine|lower or (tbl_storage_engine is empty and engine.is_default) ? ' selected' }}>
Expand All @@ -132,7 +132,7 @@
{% if have_partitioning %}
<tr class="align-top">
<th colspan="5">
{% trans 'PARTITION definition:' %}
{{ t('PARTITION definition:') }}
{{ show_mysql_docu('Partitioning') }}
</th>
</tr>
Expand All @@ -151,20 +151,20 @@
<div class="card mt-3">
<div class="card-body">
{% if action == '/table/add-field' or action == '/table/structure/save' %}
<input type="checkbox" name="online_transaction" value="ONLINE_TRANSACTION_ENABLED" />{% trans %}Online transaction{% context %}Online transaction part of the SQL DDL for InnoDB{% endtrans %}{{ show_mysql_docu('innodb-online-ddl') }}
<input type="checkbox" name="online_transaction" value="ONLINE_TRANSACTION_ENABLED" />{{ t('Online transaction', context = 'Online transaction part of the SQL DDL for InnoDB') }}{{ show_mysql_docu('innodb-online-ddl') }}
{% endif %}
<input class="btn btn-secondary preview_sql" type="button"
value="{% trans 'Preview SQL' %}">
value="{{ t('Preview SQL') }}">
<input class="btn btn-primary" type="submit"
name="do_save_data"
value="{% trans 'Save' %}">
value="{{ t('Save') }}">
</div>
</div>
<div id="properties_message"></div>
{% if is_integers_length_restricted %}
<div class="alert alert-primary" id="length_not_allowed" role="alert">
{{ get_image('s_notice') }}
{% trans %}The column width of integer types is ignored in your MySQL version unless defining a TINYINT(1) column{% endtrans %}
{{ t('The column width of integer types is ignored in your MySQL version unless defining a TINYINT(1) column') }}
{{ show_mysql_docu('', false, 'https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-19.html') }}
</div>
{% endif %}
Expand All @@ -173,13 +173,13 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="previewSqlModalLabel">{% trans 'Loading' %}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{% trans 'Close' %}"></button>
<h5 class="modal-title" id="previewSqlModalLabel">{{ t('Loading') }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{ t('Close') }}"></button>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" id="previewSQLCloseButton" data-bs-dismiss="modal">{% trans 'Close' %}</button>
<button type="button" class="btn btn-secondary" id="previewSQLCloseButton" data-bs-dismiss="modal">{{ t('Close') }}</button>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/templates/columns_definitions/column_name.twig
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<a data-maxrows="{{ max_rows }}"
href="#"
class="central_columns_dialog">
{% trans 'Pick from Central Columns' %}
{{ t('Pick from Central Columns') }}
</a>
</p>
{% endif %}
36 changes: 18 additions & 18 deletions resources/templates/columns_definitions/partitions.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<table class="table table-borderless w-auto align-middle mb-0" id="partition_table">
<tr class="align-middle">
<td><label for="partition_by">{% trans 'Partition by:' %}</label></td>
<td><label for="partition_by">{{ t('Partition by:') }}</label></td>
<td>
<select name="partition_by" id="partition_by">
{% for option in partition_options %}
Expand All @@ -29,20 +29,20 @@
</td>
<td>
(<input name="partition_expr" type="text"
placeholder="{% trans 'Expression or column list' %}"
placeholder="{{ t('Expression or column list') }}"
value="{{ partition_details['partition_expr'] }}">)
</td>
</tr>
<tr class="align-middle">
<td><label for="partition_count">{% trans 'Partitions:' %}</label></td>
<td><label for="partition_count">{{ t('Partitions:') }}</label></td>
<td colspan="2">
<input name="partition_count" type="number" min="2"
value="{{ partition_details['partition_count'] ?: '' }}">
</td>
</tr>
{% if partition_details['can_have_subpartitions'] %}
<tr class="align-middle">
<td><label for="subpartition_by">{% trans 'Subpartition by:' %}</label></td>
<td><label for="subpartition_by">{{ t('Subpartition by:') }}</label></td>
<td>
<select name="subpartition_by" id="subpartition_by">
{% for option in sub_partition_options %}
Expand All @@ -57,12 +57,12 @@
</td>
<td>
(<input name="subpartition_expr" type="text"
placeholder="{% trans 'Expression or column list' %}"
placeholder="{{ t('Expression or column list') }}"
value="{{ partition_details['subpartition_expr'] }}">)
</td>
</tr>
<tr class="align-middle">
<td><label for="subpartition_count">{% trans 'Subpartitions:' %}</label></td>
<td><label for="subpartition_count">{{ t('Subpartitions:') }}</label></td>
<td colspan="2">
<input name="subpartition_count" type="number" min="2"
value="{{ partition_details['subpartition_count'] ?: '' }}">
Expand All @@ -73,22 +73,22 @@
{% if partition_details['partition_count'] > 1 %}
<table class="table align-middle" id="partition_definition_table">
<thead><tr>
<th>{% trans 'Partition' %}</th>
<th>{{ t('Partition') }}</th>
{% if partition_details['value_enabled'] %}
<th>{% trans 'Values' %}</th>
<th>{{ t('Values') }}</th>
{% endif %}
{% if partition_details['can_have_subpartitions']
and partition_details['subpartition_count'] > 1 %}
<th>{% trans 'Subpartition' %}</th>
<th>{{ t('Subpartition') }}</th>
{% endif %}
<th>{% trans 'Engine' %}</th>
<th>{% trans 'Comment' %}</th>
<th>{% trans 'Data directory' %}</th>
<th>{% trans 'Index directory' %}</th>
<th>{% trans 'Max rows' %}</th>
<th>{% trans 'Min rows' %}</th>
<th>{% trans 'Table space' %}</th>
<th>{% trans 'Node group' %}</th>
<th>{{ t('Engine') }}</th>
<th>{{ t('Comment') }}</th>
<th>{{ t('Data directory') }}</th>
<th>{{ t('Index directory') }}</th>
<th>{{ t('Max rows') }}</th>
<th>{{ t('Min rows') }}</th>
<th>{{ t('Table space') }}</th>
<th>{{ t('Node group') }}</th>
</tr></thead>
{% for partition in partition_details['partitions'] %}
{% set rowspan = partition['subpartition_count'] is not empty
Expand Down Expand Up @@ -134,7 +134,7 @@
</td>
{% endif %}
<td>
<select name="{{ subpartition['prefix'] }}[engine]" aria-label="{% trans 'Storage engine' %}">
<select name="{{ subpartition['prefix'] }}[engine]" aria-label="{{ t('Storage engine') }}">
<option value=""></option>
{% for engine in storage_engines %}
<option value="{{ engine.name }}"{% if engine.comment is not empty %} title="{{ engine.comment }}"{% endif %}
Expand Down

0 comments on commit b1cb1c8

Please sign in to comment.