Skip to content

Commit

Permalink
Check translation length (#2072)
Browse files Browse the repository at this point in the history
* Add script to check translation length

* Cleanups

* Fix YML

* Bump Super linter version

* Fix yml

* Fix YAML

* Fix things

* Linting fixes

* Turn on logging
n

* Fix yml

* Misc fixes

* Misc fixes

* Fixes

* More fixes

* Testing

* Fixes

* More fixes

* Fix dirs

* Fix src

* Clean up

* Revert linter changes

* Add some logging
  • Loading branch information
tunetheweb committed Mar 15, 2021
1 parent e710c4e commit 8c65d7e
Show file tree
Hide file tree
Showing 17 changed files with 304 additions and 8 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/check-translations-lengths.yml
@@ -0,0 +1,57 @@
######################################
## Custom Web Almanac GitHub action ##
######################################
#
# This generates the chapters and tests the website when a pull request is
# opened (or added to) on the original repo
#
name: Check Translation Lengths
on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: '45 9 * * 0'
workflow_dispatch:
pull_request:
paths:
- '**.html'
- '**.md'

jobs:
check_lengths:
name: Check Lengths
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@v2.3.3
with:
path: this_run
# Full git history is needed to get a proper list of changed files
fetch-depth: 0
- name: Checkout Code
if: github.event_name == 'pull_request'
uses: actions/checkout@v2.3.3
with:
path: original
ref: main
repository: HTTPArchive/almanac.httparchive.org
- name: Test changed translations
if: github.event_name == 'pull_request'
env:
RUN_TYPE: ${{ github.event_name }}
COMMIT_SHA: ${{ github.sha }}
run: |
cd this_run/src
./tools/scripts/check_translation_length.sh
- name: Test all translations
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
run: |
cd this_run/src
./tools/scripts/check_translation_length.sh -a
1 change: 1 addition & 0 deletions src/content/en/2019/fonts.md
Expand Up @@ -373,6 +373,7 @@ Let's dig a bit deeper and look at the `format()` values used in the `src:` prop

{{ figure_markup(
image="fig8.png",
alt="Popularity of font formats in @font-face declarations.",
caption="Popularity of font formats in <code>@font-face</code> declarations.",
description="Bar chart showing the popularity of formats used in font-face declarations. 69% of desktop pages' @font-face declarations specify the WOFF2 format, 11% WOFF, 10% TrueType, 8% SVG, 2% EOT, and fewer than 1% OpenType, TTF, and OTF. The distribution for mobile pages is similar.",
chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQDogXDb3BwZZHrBT39qccP_LJoCScD3QEi_FmjT_8VDPD_1Srpz-g7ZuuTUEb8pYXBpDmQzZ1hQh7q/pubchart?oid=700778025&format=interactive"
Expand Down
5 changes: 4 additions & 1 deletion src/content/es/2019/fonts.md
Expand Up @@ -209,7 +209,9 @@ Como se mencionó anteriormente, una manera súper fácil de acelerar las solici

De hecho, si está usando Google Fonts, continúe y agregue esto a su `<head>` si aún no está allí:

```<link rel="preconnect" href="https://fonts.gstatic.com/">```
```html
<link rel="preconnect" href="https://fonts.gstatic.com/">
```

### Tipos de letra más populares

Expand Down Expand Up @@ -371,6 +373,7 @@ Profundicemos un poco más y veamos los valores `format()` usados en la propieda

{{ figure_markup(
image="fig8.png",
alt="Popularidad de los formatos de fuente en las declaraciones @font-face.",
caption="Popularidad de los formatos de fuente en las declaraciones <code>@font-face</code>.",
description="Gráfico de barras que muestra la popularidad de los formatos utilizados en las declaraciones de fuentes. El 69% de las declaraciones @font-face de las páginas de escritorio especifican el formato WOFF2, 11% WOFF, 10% TrueType, 8% SVG, 2% EOT y menos del 1% OpenType, TTF y OTF. La distribución de las páginas móviles es similar.",
chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQDogXDb3BwZZHrBT39qccP_LJoCScD3QEi_FmjT_8VDPD_1Srpz-g7ZuuTUEb8pYXBpDmQzZ1hQh7q/pubchart?oid=700778025&format=interactive"
Expand Down
1 change: 1 addition & 0 deletions src/content/fr/2019/css.md
Expand Up @@ -63,6 +63,7 @@ Il existe <a hreflang="en" href="https://www.w3.org/TR/css-color-4/#named-colors
}}

La langue impacte également la couleur. Il y a plus d’exemples du «`gray`» américain que du «`grey`» britannique. Presque toutes les instances de <a hreflang="en" href="https://www.rapidtables.com/web/color/gray-color.html">couleurs grises</a> («`gray`», «`lightgray`», «`darkgray`», «`slategray`», etc.) avaient presque le double de l’utilisation en étant orthographiées avec un «a» au lieu d’un «e». Si les «`gray`»/«`grey`» étaient combinés, ils se classeraient plus haut que le bleu, en quatrième place. Cela pourrait expliquer pourquoi «`silver`» est mieux classé que «`grey`» avec un «e» dans les graphiques&nbsp;!

### Nombre de couleurs

Combien de différentes couleurs de polices sont utilisées sur le Web&nbsp;? Ce n’est donc pas le nombre total de couleurs uniques&nbsp;; c’est plutôt le nombre de couleurs différentes utilisées uniquement pour le texte. Les chiffres de ce graphique sont assez élevés et, par expérience, nous savons que sans les variables CSS, l’espacement, les tailles et les couleurs peuvent rapidement vous échapper et se fragmenter en de nombreuses valeurs minuscules dans vos styles. Ces chiffres reflètent une difficulté de gestion du style, et nous espérons que cela vous aidera à créer une perspective à rapporter à vos équipes ou projets. Comment pouvez-vous réduire ce nombre à un montant gérable et raisonnable&nbsp;?
Expand Down
1 change: 1 addition & 0 deletions src/content/fr/2019/media.md
Expand Up @@ -240,6 +240,7 @@ Les gains obtenus dans ce test A/B <span lang="en">Lighthouse</span> ne concerne

{{ figure_markup(
image="fig13_project_perf_improvements_image_optimization.png",
alt="Projection que fait Lighthouse de l’amélioration des performances des pages grâce à l’optimisation des images.",
caption='Projection que fait <span lang="en">Lighthouse</span> de l’amélioration des performances des pages grâce à l’optimisation des images.',
description="Diagramme à barres montrant qu’au 10e percentile, 0&nbsp;ms pourrait être sauvée, de même au 25e percentile. Au 50e percentile, 150&nbsp;ms pourraient être sauvées. Au 75e percentile, 1460&nbsp;ms pourraient être sauvées et 90e percentile, 5720&nbsp;ms pourraient être sauvées.",
chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vSViHIntdF6-bHAI0cl1HelY_X8rR4lf0P3W2Y8I5SyVMxG-ptggTHfWA0qrrU47RvuAydLE6Zex6L3/pubchart?oid=167590779"
Expand Down
1 change: 1 addition & 0 deletions src/content/it/2020/javascript.md
@@ -1,4 +1,5 @@
---
#See https://github.com/HTTPArchive/almanac.httparchive.org/wiki/Authors'-Guide#metadata-to-add-at-the-top-of-your-chapters
title: JavaScript
description: Capitolo JavaScript del Web Almanac 2020 che copre quanto JavaScript utilizziamo sul Web, compressione, librerie e framework, caricamento e mappe di origine.
authors: [tkadlec]
Expand Down
1 change: 1 addition & 0 deletions src/content/ja/2019/http2.md
Expand Up @@ -279,6 +279,7 @@ HTTP/2プッシュは、HTTP/2の大いに宣伝された新機能であるに
chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQLxLA5Nojw28P7ceisqti3oTmNSM-HIRIR0bDb2icJS5TzONvRhdqxQcooh_45TmK97XVpot4kEQA0/pubchart?oid=466353517&format=interactive"
)
}}

図20.13は、最も一般的にプッシュされるアセットを示しています。 JavaScriptとCSSは、ボリュームとバイトの両方で、プッシュされるアイテムの圧倒的多数です。この後、画像、フォント、およびデータのラグタグの種類があります。最後にビデオをプッシュしているサイトは約100あることがわかりますが、これは意図的なものであるか、間違ったタイプのアセットを過剰にプッシュしている兆候かもしれません!

一部の人が提起する懸念の1つは、HTTP/2実装が`プリロード`HTTP`リンク`ヘッダーをプッシュする信号として再利用したことです。`プリロード`の最も一般的な使用法の1つは、CSSが要求、ダウンロード、解析されるまでブラウザに表示されない、フォントや画像などの遅れて発見されたリソースをブラウザに通知することです。これらが現在そのヘッダーに基づいてプッシュされる場合、これを再利用すると多くの意図しないプッシュを発生する可能性があるという懸念はありました。
Expand Down
3 changes: 2 additions & 1 deletion src/content/ja/2019/media.md
Expand Up @@ -153,7 +153,6 @@ CSSピクセルと自然ピクセル量を見ると、中央値のウェブサ
</tr>
</tbody>
</table>

<figcaption>{{ figure_link(caption="主流のファイル形式の説明。") }}</figcaption>
</figure>

Expand Down Expand Up @@ -295,6 +294,7 @@ CSSピクセルと自然ピクセル量を見ると、中央値のウェブサ

{{ figure_markup(
image="fig16_top_patterns_of_img_sizes.png",
alt="img sizes のトップパターン。",
caption="<code><img sizes></code> のトップパターン。",
description="1,130万枚の画像が「img sizes=`(max-width: 300px) 100vw, 300px`」を使用しており、「auto」が160万枚、「img sizes=`(max-width: 767px) 89vwなどなど`」が100万枚、「100vw」が23万枚、「300px」が13万枚であることを棒グラフで示しています。",
chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vSViHIntdF6-bHAI0cl1HelY_X8rR4lf0P3W2Y8I5SyVMxG-ptggTHfWA0qrrU47RvuAydLE6Zex6L3/pubchart?oid=663985412&format=interactive"
Expand All @@ -309,6 +309,7 @@ CSSピクセルと自然ピクセル量を見ると、中央値のウェブサ

{{ figure_markup(
image="fig17_usage_of_accept-ch_http_v_html.png",
alt="Accept-CH ヘッダーと同等の meta タグの使用法。",
caption="<code>Accept-CH</code> ヘッダーと同等の <code><meta></code> タグの使用法。",
description="71%が'meta http-equiv'を使用し、30% が'Accept-CH'HTTPヘッダーを使用し、1%が両方を使用していることを示す棒グラフです。",
chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vSViHIntdF6-bHAI0cl1HelY_X8rR4lf0P3W2Y8I5SyVMxG-ptggTHfWA0qrrU47RvuAydLE6Zex6L3/pubchart?oid=284657706&format=interactive"
Expand Down
17 changes: 16 additions & 1 deletion src/templates/es/2020/base.html
Expand Up @@ -6,6 +6,21 @@
{% block dataset %}Agosto de 2020{% endblock %}

{% block foreword %}
{# TODO - Write this! #}
{# TODO - Translate this! #}
{{ self.coming_soon() }}















{% endblock %}
17 changes: 16 additions & 1 deletion src/templates/hi/2020/base.html
Expand Up @@ -6,6 +6,21 @@
{% block dataset %}अगस्त 2020{% endblock %}

{% block foreword %}
{# TODO - Write this! #}
{# TODO - Translate this! #}
{{ self.coming_soon() }}















{% endblock %}
1 change: 1 addition & 0 deletions src/templates/hi/base.html
Expand Up @@ -119,6 +119,7 @@
{% block methodology_description %}
जब तक अन्यथा नोट न किया जाए, {{ year }} Web Almanac के सभी {{ supported_chapters | length }} अध्यायों में मौजूद मेट्रिक्स HTTP Archive के स्रोतों से लिये जाते हैं। HTTP Archive एक समुदाय द्वारा संचालित परियोजना है, जो 2010 के बाद से वेब कैसे बनाया जा रहा है इस पर निगाह रखें हुए हैं। WebPageTest और Lighthouse का अति उत्कृष्ट उपयोग करते हुए, {{ self.total_websites() }} वेबसाइटों के बारे में मेटाडेटा को मासिक रूप से परीक्षण किया जाता है और विश्लेषण के लिए एक सार्वजनिक BigQuery डेटाबेस में शामिल किया जाता है। {{ self.dataset() }} डेटासेट का उपयोग {{ year }} Web Almanac के मैट्रिक्स के आधार के रूप में किया गया था। अधिक जानकारी के लिए, कार्यप्रणाली पृष्ठ देखें।
{% endblock %}

{% block introduction %}परिचय{% endblock %}

{% block foreword_title %}प्रस्तावना{% endblock %}
Expand Down
17 changes: 16 additions & 1 deletion src/templates/ja/2020/base.html
Expand Up @@ -6,6 +6,21 @@
{% block dataset %}2020年8{% endblock %}

{% block foreword %}
{# TODO - Write this! #}
{# TODO - Translate this! #}
{{ self.coming_soon() }}















{% endblock %}
1 change: 1 addition & 0 deletions src/templates/ja/base.html
Expand Up @@ -85,6 +85,7 @@

{% block author %}著者{% endblock %}
{% block authors %}著者{% endblock %}

{% macro onTwitter(twitterHandle) %}Twitterの@{{twitterHandle}}{% endmacro %}
{% macro onGitHub(gitHubHandle) %}GitHubの{{gitHubHandle}}{% endmacro %}
{% macro onLinkedIn(authorName) %}LinkedInの{{authorName}}{% endmacro %}
Expand Down
17 changes: 16 additions & 1 deletion src/templates/ru/2020/base.html
Expand Up @@ -6,6 +6,21 @@
{% block dataset %}август 2020{% endblock %}

{% block foreword %}
{# TODO - Write this! #}
{# TODO - Translate this! #}
{{ self.coming_soon() }}















{% endblock %}
17 changes: 16 additions & 1 deletion src/templates/zh-CN/2020/base.html
Expand Up @@ -6,6 +6,21 @@
{% block dataset %}2020年8{% endblock %}

{% block foreword %}
{# TODO - Write this! #}
{# TODO - Translate this! #}
{{ self.coming_soon() }}















{% endblock %}
17 changes: 16 additions & 1 deletion src/templates/zh-TW/2020/base.html
Expand Up @@ -6,6 +6,21 @@
{% block dataset %}2020年8{% endblock %}

{% block foreword %}
{# TODO - Write this! #}
{# TODO - Translate this! #}
{{ self.coming_soon() }}















{% endblock %}

0 comments on commit 8c65d7e

Please sign in to comment.