Skip to content

Commit

Permalink
remove translation
Browse files Browse the repository at this point in the history
  • Loading branch information
tiritibambix committed Jan 12, 2025
1 parent 7fa1c71 commit 4c44f06
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 659 deletions.
137 changes: 18 additions & 119 deletions app.py

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions templates/resize.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html lang="{{ session.get('lang', 'en') }}">
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ _('Resize Options') }}</title>
<title>Resize Options</title>
<style>
:root {
--clr-primary-a0: #808080;
Expand Down Expand Up @@ -140,63 +140,63 @@
</head>
<body>
<div class="container">
<h4>{{ _('Resize Image: %(filename)s', filename=filename) }}</h4>
<form action="{{ url_for_with_lang('resize_image', filename=filename) }}" method="post">
<h4>Resize Image: {{ filename }}</h4>
<form action="{{ url_for('resize_image', filename=filename) }}" method="post">
<fieldset>
<legend>{{ _('Resize by Pixels') }}</legend>
<legend>Resize by Pixels</legend>
<div class="form-group">
<label for="width">{{ _('Width:') }}</label>
<input type="text" name="width" id="width" placeholder="{{ _('Enter width') }}" data-original-width="{{ width }}" data-original-height="{{ height }}">
<label for="width">Width:</label>
<input type="text" name="width" id="width" placeholder="Enter width" data-original-width="{{ width }}" data-original-height="{{ height }}">
</div>
<div class="form-group">
<label for="height">{{ _('Height:') }}</label>
<input type="text" name="height" id="height" placeholder="{{ _('Enter height') }}" data-original-width="{{ width }}" data-original-height="{{ height }}">
<label for="height">Height:</label>
<input type="text" name="height" id="height" placeholder="Enter height" data-original-width="{{ width }}" data-original-height="{{ height }}">
</div>
<div class="form-group">
<label>
<input type="checkbox" name="keep_ratio" id="keep_ratio"> {{ _('Keep Aspect Ratio') }}
<input type="checkbox" name="keep_ratio" id="keep_ratio"> Keep Aspect Ratio
</label>
</div>
<small>{{ _('Original dimensions: %(width)s x %(height)s pixels', width=width, height=height) }}</small>
<small>Original dimensions: {{ width }} x {{ height }} pixels</small>
</fieldset>

<fieldset>
<legend>{{ _('Resize by Percentage') }}</legend>
<legend>Resize by Percentage</legend>
<div class="form-group">
<label for="percentage">{{ _('Percentage:') }}</label>
<input type="text" name="percentage" id="percentage" placeholder="{{ _('Enter percentage (1-100)') }}">
<label for="percentage">Percentage:</label>
<input type="text" name="percentage" id="percentage" placeholder="Enter percentage (1-100)">
</div>
</fieldset>

<fieldset>
<legend>{{ _('Additional Options') }}</legend>
<legend>Additional Options</legend>
<div class="form-group">
<label for="quality">{{ _('Quality (1-100):') }}</label>
<label for="quality">Quality (1-100):</label>
<input type="text" name="quality" id="quality" value="100">
</div>
<div class="form-group">
<label for="format">{{ _('Convert to format:') }}</label>
<label for="format">Convert to format:</label>
<select name="format" id="format">
<option value="">{{ _('Keep original format') }}</option>
<option value="">Keep original format</option>
{% if formats.recommended %}
<optgroup label="{{ _('Recommended formats') }}">
<optgroup label="Recommended formats">
{% for fmt in formats.recommended %}
<option value="{{ fmt|lower }}">{{ fmt }}
{% if image_type %}
{% if (image_type.has_transparency and fmt in ['PNG', 'WebP', 'AVIF']) %}
({{ _('Best for transparency') }})
(Best for transparency)
{% elif (image_type.is_photo and fmt in ['JPEG', 'WebP', 'AVIF']) %}
({{ _('Best for photos') }})
(Best for photos)
{% elif (not image_type.is_photo and fmt in ['PNG', 'GIF', 'WebP']) %}
({{ _('Best for graphics') }})
(Best for graphics)
{% endif %}
{% endif %}
</option>
{% endfor %}
</optgroup>
{% endif %}
{% if formats.compatible %}
<optgroup label="{{ _('Other compatible formats') }}">
<optgroup label="Other compatible formats">
{% for fmt in formats.compatible %}
<option value="{{ fmt|lower }}">{{ fmt }}</option>
{% endfor %}
Expand All @@ -208,19 +208,19 @@ <h4>{{ _('Resize Image: %(filename)s', filename=filename) }}</h4>
<div class="image-info">
<small>
{% if image_type.has_transparency %}
{{ _('This image contains transparency.') }}
This image contains transparency.
{% endif %}
{% if image_type.is_photo %}
{{ _('This appears to be a photographic image.') }}
This appears to be a photographic image.
{% else %}
{{ _('This appears to be a graphic image.') }}
This appears to be a graphic image.
{% endif %}
</small>
</div>
{% endif %}
</fieldset>

<button type="submit">{{ _('Resize') }}</button>
<button type="submit">Resize</button>
</form>
</div>
<script>
Expand Down
62 changes: 31 additions & 31 deletions templates/resize_batch.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html lang="{{ session.get('lang', 'en') }}">
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ _('Batch Resize') }}</title>
<title>Batch Resize</title>
<style>
:root {
--clr-primary-a0: #808080;
Expand Down Expand Up @@ -140,65 +140,65 @@
</head>
<body>
<div class="container">
<h1>{{ _('Batch Resize') }}</h1>
<form action="{{ url_for_with_lang('resize_batch') }}" method="post">
<h1>Batch Resize</h1>
<form action="{{ url_for('resize_batch') }}" method="post">
<input type="hidden" name="filenames" value="{{ ','.join(files) }}">
<fieldset>
<legend>{{ _('Resize Options') }}</legend>
<legend>Resize Options</legend>
<div class="form-group">
<label for="batch_width">{{ _('Width:') }}</label>
<input type="text" name="width" id="batch_width" placeholder="{{ _('Enter width') }}">
<label for="batch_width">Width:</label>
<input type="text" name="width" id="batch_width" placeholder="Enter width">
</div>
<div class="form-group">
<label for="batch_height">{{ _('Height:') }}</label>
<input type="text" name="height" id="batch_height" placeholder="{{ _('Enter height') }}">
<label for="batch_height">Height:</label>
<input type="text" name="height" id="batch_height" placeholder="Enter height">
</div>
<div class="form-group">
<label>
<input type="checkbox" name="keep_ratio" id="batch_keep_ratio"> {{ _('Keep Aspect Ratio') }}
<input type="checkbox" name="keep_ratio" id="batch_keep_ratio"> Keep Aspect Ratio
</label>
</div>
</fieldset>

<fieldset>
<legend>{{ _('Resize by Percentage') }}</legend>
<legend>Resize by Percentage</legend>
<div class="form-group">
<label for="batch_percentage">{{ _('Percentage:') }}</label>
<input type="text" name="percentage" id="batch_percentage" placeholder="{{ _('Enter percentage (1-100)') }}">
<label for="batch_percentage">Percentage:</label>
<input type="text" name="percentage" id="batch_percentage" placeholder="Enter percentage (1-100)">
</div>
</fieldset>

<fieldset>
<legend>{{ _('Additional Options') }}</legend>
<legend>Additional Options</legend>
<div class="form-group">
<label for="quality">{{ _('Quality (1-100):') }}</label>
<label for="quality">Quality (1-100):</label>
<input type="text" name="quality" id="quality" value="100">
</div>
<div class="form-group">
<label for="format">{{ _('Convert all to format:') }}</label>
<label for="format">Convert all to format:</label>
<select name="format" id="format">
<option value="">{{ _('Keep Original Formats') }}</option>
<option value="">Keep Original Formats</option>
{% if formats.recommended %}
<optgroup label="{{ _('Recommended Formats') }}">
<optgroup label="Recommended Formats">
{% for fmt in formats.recommended %}
<option value="{{ fmt|lower }}">{{ fmt }}
{% if batch_info %}
{% if (batch_info.has_transparency and fmt in ['PNG', 'WebP', 'AVIF']) %}
({{ _('Best for transparency') }})
(Best for transparency)
{% endif %}
{% if (batch_info.has_photos and fmt in ['JPEG', 'WebP', 'AVIF']) %}
({{ _('Best for photos') }})
(Best for photos)
{% endif %}
{% if (batch_info.has_graphics and fmt in ['PNG', 'GIF', 'WebP']) %}
({{ _('Best for graphics') }})
(Best for graphics)
{% endif %}
{% endif %}
</option>
{% endfor %}
</optgroup>
{% endif %}
{% if formats.compatible %}
<optgroup label="{{ _('Other Compatible Formats') }}">
<optgroup label="Other Compatible Formats">
{% for fmt in formats.compatible %}
<option value="{{ fmt|lower }}">{{ fmt }}</option>
{% endfor %}
Expand All @@ -209,16 +209,16 @@ <h1>{{ _('Batch Resize') }}</h1>
{% if batch_info %}
<div class="batch-info">
<small>
{{ _('Your batch contains:') }}
Your batch contains:
<ul>
{% if batch_info.has_transparency %}
<li>{{ _('Images with transparency') }}</li>
<li>Images with transparency</li>
{% endif %}
{% if batch_info.has_photos %}
<li>{{ _('Photographic images') }}</li>
<li>Photographic images</li>
{% endif %}
{% if batch_info.has_graphics %}
<li>{{ _('Graphic images') }}</li>
<li>Graphic images</li>
{% endif %}
</ul>
</small>
Expand All @@ -227,17 +227,17 @@ <h1>{{ _('Batch Resize') }}</h1>
{% if image_types %}
<div class="images-info">
<small>
{{ _('Details for each image:') }}
Details for each image:
<ul>
{% for img in image_types %}
<li>{{ img.filename }}:
{% if img.type.has_transparency %}
{{ _('Contains transparency') }},
Contains transparency,
{% endif %}
{% if img.type.is_photo %}
{{ _('Photographic image') }}
Photographic image
{% else %}
{{ _('Graphic image') }}
Graphic image
{% endif %}
</li>
{% endfor %}
Expand All @@ -247,7 +247,7 @@ <h1>{{ _('Batch Resize') }}</h1>
{% endif %}
</fieldset>

<button type="submit">{{ _('Resize All') }}</button>
<button type="submit">Resize All</button>
</form>
</div>
<script>
Expand Down
58 changes: 0 additions & 58 deletions translations/en/LC_MESSAGES/messages.po

This file was deleted.

Loading

0 comments on commit 4c44f06

Please sign in to comment.