diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..677477f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig +root = true + +# elementary defaults +[*] +charset = utf-8 +end_of_line = lf +indent_size = tab +indent_style = space +insert_final_newline = true +max_line_length = 80 +tab_width = 4 + +# Markup files +[{*.html,*.xml,*.xml.in,*.yml}] +tab_width = 2 diff --git a/.gitignore b/.gitignore index ca6cfcb..1682ae2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,3 @@ *.swp *~ - build -.ninja_* -build.ninja -data/writeas diff --git a/data/writeas-gtk.appdata.xml.in b/data/com.github.writeas.writeas-gtk.appdata.xml.in similarity index 96% rename from data/writeas-gtk.appdata.xml.in rename to data/com.github.writeas.writeas-gtk.appdata.xml.in index 7107478..9b87fe5 100644 --- a/data/writeas-gtk.appdata.xml.in +++ b/data/com.github.writeas.writeas-gtk.appdata.xml.in @@ -1,6 +1,6 @@ - @app_id@ + com.github.writeas.writeas-gtk GPL-3.0+ CC0 Write.as @@ -16,7 +16,7 @@
  • Work on a single local draft, then publish or save as another file when you're finished
  • Choose from three different fonts: serif, sans-serif, or monospace
  • Dark mode on platforms that support it
  • -
  • Publish to Write.as and share your post (example)
  • +
  • Publish to Write.as and share your post
  • Manage published posts with the built-in command-line interface
  • @@ -28,7 +28,7 @@ hello@write.as - @app_id@ + com.github.writeas.writeas-gtk diff --git a/data/writeas-gtk.desktop.in b/data/com.github.writeas.writeas-gtk.desktop.in similarity index 73% rename from data/writeas-gtk.desktop.in rename to data/com.github.writeas.writeas-gtk.desktop.in index 0ec22b5..1c4f71a 100644 --- a/data/writeas-gtk.desktop.in +++ b/data/com.github.writeas.writeas-gtk.desktop.in @@ -2,8 +2,8 @@ Type=Application Name=Write.as Comment=Publish a thought in seconds. -Exec=@app_id@ -Icon=@app_id@ +Exec=com.github.writeas.writeas-gtk +Icon=com.github.writeas.writeas-gtk Terminal=false MimeType= Categories=GTK;Office;Publishing; diff --git a/data/icons/128/writeas-gtk.png b/data/icons/128/com.github.writeas.writeas-gtk.png similarity index 100% rename from data/icons/128/writeas-gtk.png rename to data/icons/128/com.github.writeas.writeas-gtk.png diff --git a/data/icons/16/writeas-gtk.png b/data/icons/16/com.github.writeas.writeas-gtk.png similarity index 100% rename from data/icons/16/writeas-gtk.png rename to data/icons/16/com.github.writeas.writeas-gtk.png diff --git a/data/icons/24/writeas-gtk.png b/data/icons/24/com.github.writeas.writeas-gtk.png similarity index 100% rename from data/icons/24/writeas-gtk.png rename to data/icons/24/com.github.writeas.writeas-gtk.png diff --git a/data/icons/32/writeas-gtk.png b/data/icons/32/com.github.writeas.writeas-gtk.png similarity index 100% rename from data/icons/32/writeas-gtk.png rename to data/icons/32/com.github.writeas.writeas-gtk.png diff --git a/data/icons/48/writeas-gtk.png b/data/icons/48/com.github.writeas.writeas-gtk.png similarity index 100% rename from data/icons/48/writeas-gtk.png rename to data/icons/48/com.github.writeas.writeas-gtk.png diff --git a/data/icons/64/writeas-gtk.png b/data/icons/64/com.github.writeas.writeas-gtk.png similarity index 100% rename from data/icons/64/writeas-gtk.png rename to data/icons/64/com.github.writeas.writeas-gtk.png diff --git a/data/meson.build b/data/meson.build index 73b7444..59bd02a 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,24 +1,32 @@ +# Install icons icon_sizes = ['16', '24', '32', '48', '64', '128'] foreach i : icon_sizes - install_data( - join_paths('icons', i, meson.project_name() + '.png'), - install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps'), - rename: '@0@.png'.format(app_id) + install_data ( + join_paths ('icons', i, meson.project_name () + '.png'), + install_dir: join_paths (get_option ('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps') + ) + install_data ( + join_paths ('icons', i, meson.project_name () + '.png'), + install_dir: join_paths (get_option ('datadir'), 'icons', 'hicolor', i + 'x' + i + '@2', 'apps') ) endforeach -data_conf = configuration_data() -data_conf.set('app_id', app_id) -configure_file( - input: 'writeas-gtk.desktop.in', - output: '@0@.desktop'.format(app_id), - configuration: data_conf, - install_dir: join_paths(get_option('datadir'), 'applications') +# Translate and install our .desktop file so the Applications Menu will see it +i18n.merge_file ( + input: meson.project_name () + '.desktop.in', + output: meson.project_name () + '.desktop', + po_dir: join_paths (meson.source_root (), 'po', 'extra'), + type: 'desktop', + install: true, + install_dir: join_paths (get_option ('datadir'), 'applications') ) -configure_file( - input: 'writeas-gtk.appdata.xml.in', - output: '@0@.appdata.xml'.format(app_id), - configuration: data_conf, - install_dir: join_paths(get_option('datadir'), 'metainfo') + +# Translate and install our .appdata.xml file so AppCenter will see it +i18n.merge_file ( + input: meson.project_name () + '.appdata.xml.in', + output: meson.project_name () + '.appdata.xml', + po_dir: join_paths (meson.source_root (), 'po', 'extra'), + install: true, + install_dir: join_paths (get_option ('datadir'), 'metainfo') ) diff --git a/screenshot-monospace.png b/data/screenshots/screenshot-monospace.png similarity index 100% rename from screenshot-monospace.png rename to data/screenshots/screenshot-monospace.png diff --git a/screenshot-sans-light.png b/data/screenshots/screenshot-sans-light.png similarity index 100% rename from screenshot-sans-light.png rename to data/screenshots/screenshot-sans-light.png diff --git a/screenshot-serif-dark.png b/data/screenshots/screenshot-serif-dark.png similarity index 100% rename from screenshot-serif-dark.png rename to data/screenshots/screenshot-serif-dark.png diff --git a/screenshot-serif-light.png b/data/screenshots/screenshot-serif-light.png similarity index 100% rename from screenshot-serif-light.png rename to data/screenshots/screenshot-serif-light.png diff --git a/meson.build b/meson.build index 00b1074..56f0f0d 100644 --- a/meson.build +++ b/meson.build @@ -1,29 +1,45 @@ -project('writeas-gtk', ['vala', 'c'], +# Project name, programming language and version +project ( + 'com.github.writeas.writeas-gtk', + 'c', 'vala', version: '1.0.2', - license: 'GPL', - meson_version: '>=0.46.0') +) -i18n = import('i18n') -build_platform = get_option('platform') -if build_platform == 'elementary' - app_id = 'com.github.writeas.writeas-gtk' -else - app_id = 'writeas-gtk' -endif +# GNOME module +gnome = import ('gnome') -conf = configuration_data() -conf.set_quoted('GETTEXT_PACKAGE', app_id) -conf.set_quoted('APP_ID', app_id) -conf.set_quoted('BUILD_PLATFORM', build_platform) -config_h = configure_file(output: 'config.h', configuration: conf) -config_h_dir = include_directories('.') +# Translation module +i18n = import ('i18n') + + +# Project arguments +add_project_arguments ( + '-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name ()), + language: 'c' +) + +# Listing dependencies +dependencies = [ + dependency ('gtk+-3.0'), + dependency ('gtksourceview-3.0') +] run_target('build', command: 'meson/build-cli.sh') -subdir('data') -subdir('src') -subdir('fonts/lora') +subdir ('src') + +# Define executable +executable ( + meson.project_name (), + sources, + dependencies: dependencies, + install: true +) + +subdir ('data') +subdir ('po') -meson.add_install_script('meson/post_install.py') +subdir ('fonts/lora') +meson.add_install_script ('meson/post_install.py') diff --git a/meson/build-cli.sh b/meson/build-cli.sh index 023c655..c42d042 100755 --- a/meson/build-cli.sh +++ b/meson/build-cli.sh @@ -1,7 +1,3 @@ -#!/bin/bash - -exec_name=writeas - -echo "Building $exec_name CLI..." +echo "Building $exec_name CLI…" gb build github.com/writeas/writeas-cli/cmd/writeas && echo "Success." diff --git a/meson/post_install.py b/meson/post_install.py index 7634127..f0e9ea9 100644 --- a/meson/post_install.py +++ b/meson/post_install.py @@ -1,22 +1,15 @@ #!/usr/bin/env python3 -import os +from os import path, environ import subprocess -prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local') -datadir = os.path.join(prefix, 'share') +prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local') +schemadir = path.join(environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas') +datadir = path.join(prefix, 'share') +desktop_database_dir = path.join(datadir, 'applications') -# Packaging tools define DESTDIR and this isn't needed for them -if 'DESTDIR' not in os.environ: - print('Updating icon cache...') - icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor') - if not os.path.exists(icon_cache_dir): - os.makedirs(icon_cache_dir) - subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir]) - - print('Updating desktop database...') - desktop_database_dir = os.path.join(datadir, 'applications') - if not os.path.exists(desktop_database_dir): - os.makedirs(desktop_database_dir) +if not environ.get('DESTDIR'): + print('Updating desktop database…') subprocess.call(['update-desktop-database', '-q', desktop_database_dir]) - + print('Updating icon cache…') + subprocess.call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')]) \ No newline at end of file diff --git a/meson_options.txt b/meson_options.txt deleted file mode 100644 index 29bd56e..0000000 --- a/meson_options.txt +++ /dev/null @@ -1 +0,0 @@ -option('platform', type: 'combo', choices: ['default', 'elementary'], value: 'default') diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 0000000..717280a --- /dev/null +++ b/po/LINGUAS @@ -0,0 +1 @@ +fr \ No newline at end of file diff --git a/po/POTFILES b/po/POTFILES new file mode 100644 index 0000000..97ad7fb --- /dev/null +++ b/po/POTFILES @@ -0,0 +1,2 @@ +src/Granite/Accels.vala +src/Window.vala diff --git a/po/com.github.writeas.writeas-gtk.pot b/po/com.github.writeas.writeas-gtk.pot new file mode 100644 index 0000000..aba4fef --- /dev/null +++ b/po/com.github.writeas.writeas-gtk.pot @@ -0,0 +1,97 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the com.github.writeas.writeas-gtk package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: com.github.writeas.writeas-gtk\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-11-19 15:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: src/Granite/Accels.vala:42 +msgid "Shift" +msgstr "" + +#: src/Granite/Accels.vala:46 +msgid "Ctrl" +msgstr "" + +#: src/Granite/Accels.vala:50 +msgid "Alt" +msgstr "" + +#. TRANSLATORS: This is a non-symbol representation of the "-" key +#: src/Granite/Accels.vala:69 +msgid "Minus" +msgstr "" + +#. TRANSLATORS: This is a non-symbol representation of the "+" key +#: src/Granite/Accels.vala:74 +msgid "Plus" +msgstr "" + +#: src/Granite/Accels.vala:78 +msgid "Enter" +msgstr "" + +#. TRANSLATORS: This is a delimiter that separates two keyboard shortcut labels like "⌘ + →, Control + A" +#: src/Granite/Accels.vala:124 +msgid ", " +msgstr "" + +#: src/Window.vala:56 +#, c-format +msgid "%i word" +msgid_plural "%i words" +msgstr[0] "" +msgstr[1] "" + +#: src/Window.vala:144 +msgid "Publish to Write.as on the web" +msgstr "" + +#: src/Window.vala:154 +msgid "Light theme" +msgstr "" + +#: src/Window.vala:155 +msgid "Dark theme" +msgstr "" + +#: src/Window.vala:158 +msgid "Toggle light/dark theme" +msgstr "" + +#: src/Window.vala:172 +msgid "Change document font" +msgstr "" + +#: src/Window.vala:177 +msgid "Serif" +msgstr "" + +#: src/Window.vala:178 +msgid "Sans-serif" +msgstr "" + +#: src/Window.vala:180 +msgid "Monospace" +msgstr "" + +#: src/Window.vala:374 +msgid "Save as" +msgstr "" + +#: src/Window.vala:387 +msgid "Cancel" +msgstr "" diff --git a/po/extra/LINGUAS b/po/extra/LINGUAS new file mode 100644 index 0000000..717280a --- /dev/null +++ b/po/extra/LINGUAS @@ -0,0 +1 @@ +fr \ No newline at end of file diff --git a/po/extra/POTFILES b/po/extra/POTFILES new file mode 100644 index 0000000..ad9f2ac --- /dev/null +++ b/po/extra/POTFILES @@ -0,0 +1,2 @@ +data/com.github.writeas.writeas-gtk.desktop.in +data/com.github.writeas.writeas-gtk.appdata.xml.in \ No newline at end of file diff --git a/po/extra/extra.pot b/po/extra/extra.pot new file mode 100644 index 0000000..0870b01 --- /dev/null +++ b/po/extra/extra.pot @@ -0,0 +1,140 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the extra package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: extra\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-11-19 15:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: data/com.github.writeas.writeas-gtk.desktop.in:4 +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:6 +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:24 +msgid "Write.as" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.desktop.in:5 +msgid "Publish a thought in seconds." +msgstr "" + +#: data/com.github.writeas.writeas-gtk.desktop.in:7 +msgid "com.github.writeas.writeas-gtk" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.desktop.in:11 +msgid "blog;text;editor;publish;" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:7 +msgid "Publish a thought in seconds" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:10 +msgid "" +"Write.as is a simple writing tool and publishing platform. There's no sign " +"up — just open the app, write something, and publish." +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:11 +msgid "" +"Published posts get a secret, unique link on Write.as that you can share " +"with anyone, or keep to yourself. In either case, you remain private because " +"we don't collect personal information about you." +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:13 +msgid "Simple, distraction-free editor built for your words" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:14 +msgid "Instantly launches to a blank page or your last draft" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:15 +msgid "Writing automatically saves as you type" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:16 +msgid "" +"Work on a single local draft, then publish or save as another file when " +"you're finished" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:17 +msgid "Choose from three different fonts: serif, sans-serif, or monospace" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:18 +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:103 +msgid "Dark mode on platforms that support it" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:19 +msgid "Publish to Write.as and share your post" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:20 +msgid "Manage published posts with the built-in command-line interface" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:36 +msgid "The Write.as editor." +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:40 +msgid "The Write.as editor in dark mode." +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:82 +msgid "This update fixes a few minor visual issues." +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:84 +msgid "Fix black bar that appears in the editor on elementary OS" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:85 +msgid "Fix currently-selected font not reflected in menu when app first loads" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:91 +msgid "GTK updates and fixes." +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:93 +msgid "Fix fonts, padding, cursor color" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:94 +msgid "Increase the default font size" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:100 +msgid "Initial release" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:102 +msgid "Auto-saving single draft" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:104 +msgid "Choose between three fonts" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:105 +msgid "Save draft as another file" +msgstr "" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:106 +msgid "Publish anonymously to Write.as" +msgstr "" diff --git a/po/extra/fr.po b/po/extra/fr.po new file mode 100644 index 0000000..c5d2145 --- /dev/null +++ b/po/extra/fr.po @@ -0,0 +1,155 @@ +# French translations for extra package. +# Copyright (C) 2021 THE extra'S COPYRIGHT HOLDER +# This file is distributed under the same license as the extra package. +# Nathan Bonnemains (@NathanBnm), 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: extra\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-11-19 15:58+0100\n" +"PO-Revision-Date: 2021-11-19 15:53+0100\n" +"Last-Translator: Nathan Bonnemains (@NathanBnm)\n" +"Language-Team: \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: data/com.github.writeas.writeas-gtk.desktop.in:4 +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:6 +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:24 +msgid "Write.as" +msgstr "Write.as" + +#: data/com.github.writeas.writeas-gtk.desktop.in:5 +msgid "Publish a thought in seconds." +msgstr "Publiez vos pensées en quelques secondes." + +#: data/com.github.writeas.writeas-gtk.desktop.in:7 +msgid "com.github.writeas.writeas-gtk" +msgstr "com.github.writeas.writeas-gtk" + +#: data/com.github.writeas.writeas-gtk.desktop.in:11 +msgid "blog;text;editor;publish;" +msgstr "blog;texte;éditeur;publier;" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:7 +msgid "Publish a thought in seconds" +msgstr "Publiez vos pensées en quelques secondes" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:10 +msgid "" +"Write.as is a simple writing tool and publishing platform. There's no sign " +"up — just open the app, write something, and publish." +msgstr "" +"Write.as est une simple application d'écriture et de publication. Il n'y a " +"pas d'inscription — ouvrez simplement l'application, écrivez quelque-chose, " +"et publiez-le." + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:11 +msgid "" +"Published posts get a secret, unique link on Write.as that you can share " +"with anyone, or keep to yourself. In either case, you remain private because " +"we don't collect personal information about you." +msgstr "" +"Les publications possèdent un lien unique et secret sur Write.as que vous " +"pouvez partager avec qui vous souhaitez, ou bien le garder pour vous. Dans " +"tous les cas, cela reste privé car nous ne collectons pas d'informations " +"personnelles sur vous." + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:13 +msgid "Simple, distraction-free editor built for your words" +msgstr "Un éditeur simple, sans distraction construit pour vos écritures" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:14 +msgid "Instantly launches to a blank page or your last draft" +msgstr "" +"Lancement instantanné sur une page blanche ou bien votre dernier brouillon" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:15 +msgid "Writing automatically saves as you type" +msgstr "Enregistrement automatique au fur et à mesure que vous tapez" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:16 +msgid "" +"Work on a single local draft, then publish or save as another file when " +"you're finished" +msgstr "" +"Travaillez sur un brouillon local, puis publiez ou enregistrez le en tant " +"que fichier lorsqu'il est terminé" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:17 +msgid "Choose from three different fonts: serif, sans-serif, or monospace" +msgstr "" +"Choisissez parmi trois différentes polices : serif, sans-serif ou monospace" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:18 +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:103 +msgid "Dark mode on platforms that support it" +msgstr "Thème sombre sur les plateformes qui le supportent" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:19 +msgid "Publish to Write.as and share your post" +msgstr "Publiez sur Write.as et partagez votre publication" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:20 +msgid "Manage published posts with the built-in command-line interface" +msgstr "" +"Gérez vos publications publiées avec l'interface en ligne de commande incluse" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:36 +msgid "The Write.as editor." +msgstr "L'éditeur Write.as" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:40 +msgid "The Write.as editor in dark mode." +msgstr "L'éditeur Write.as avec le thème sombre" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:82 +msgid "This update fixes a few minor visual issues." +msgstr "Cette mise à jour corrige quelques problèmes graphiques mineurs." + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:84 +msgid "Fix black bar that appears in the editor on elementary OS" +msgstr "" +"Correction de la barre noire qui apparaît dans l'éditeur sur elementary OS" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:85 +msgid "Fix currently-selected font not reflected in menu when app first loads" +msgstr "" +"Correction de la police sélectionnée qui ne s'appliquait pas dans le menu au " +"premier chargement de l'application" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:91 +msgid "GTK updates and fixes." +msgstr "Mise à jour de GTK et corrections." + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:93 +msgid "Fix fonts, padding, cursor color" +msgstr "Correction des polices, des marges et de la couleur du curseur" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:94 +msgid "Increase the default font size" +msgstr "Augmentation de la taille de la police par défaut" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:100 +msgid "Initial release" +msgstr "Version initiale" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:102 +msgid "Auto-saving single draft" +msgstr "Enregistrement automatique d'un simple brouillon" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:104 +msgid "Choose between three fonts" +msgstr "Choisissez parmi tois polices" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:105 +msgid "Save draft as another file" +msgstr "Enregisrez le brouillon dans un autre fichier" + +#: data/com.github.writeas.writeas-gtk.appdata.xml.in:106 +msgid "Publish anonymously to Write.as" +msgstr "Publiez anonymement sur Write.as" diff --git a/po/extra/meson.build b/po/extra/meson.build new file mode 100644 index 0000000..637dc67 --- /dev/null +++ b/po/extra/meson.build @@ -0,0 +1,8 @@ +# Install metadata translations +i18n.gettext ('extra', + args: [ + '--directory=' + meson.source_root (), + '--from-code=UTF-8' + ], + install: false +) \ No newline at end of file diff --git a/po/fr.po b/po/fr.po new file mode 100644 index 0000000..2dbb7ec --- /dev/null +++ b/po/fr.po @@ -0,0 +1,96 @@ +# French translations for com.github.writeas.writeas-gtk package. +# Copyright (C) 2021 THE com.github.writeas.writeas-gtk'S COPYRIGHT HOLDER +# This file is distributed under the same license as the com.github.writeas.writeas-gtk package. +# Nathan Bonnemains (@NathanBnm), 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: com.github.writeas.writeas-gtk\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-11-19 15:58+0100\n" +"PO-Revision-Date: 2021-11-19 15:53+0100\n" +"Last-Translator: Nathan Bonnemains (@NathanBnm)\n" +"Language-Team: \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: src/Granite/Accels.vala:42 +msgid "Shift" +msgstr "Maj" + +#: src/Granite/Accels.vala:46 +msgid "Ctrl" +msgstr "Ctrl" + +#: src/Granite/Accels.vala:50 +msgid "Alt" +msgstr "Alt" + +#. TRANSLATORS: This is a non-symbol representation of the "-" key +#: src/Granite/Accels.vala:69 +msgid "Minus" +msgstr "Moins" + +#. TRANSLATORS: This is a non-symbol representation of the "+" key +#: src/Granite/Accels.vala:74 +msgid "Plus" +msgstr "Plus" + +#: src/Granite/Accels.vala:78 +msgid "Enter" +msgstr "Entrée" + +#. TRANSLATORS: This is a delimiter that separates two keyboard shortcut labels like "⌘ + →, Control + A" +#: src/Granite/Accels.vala:124 +msgid ", " +msgstr ", " + +#: src/Window.vala:56 +#, c-format +msgid "%i word" +msgid_plural "%i words" +msgstr[0] "%i mot" +msgstr[1] "%i mots" + +#: src/Window.vala:144 +msgid "Publish to Write.as on the web" +msgstr "Publier vers Write.as sur le Web" + +#: src/Window.vala:154 +msgid "Light theme" +msgstr "Thème clair" + +#: src/Window.vala:155 +msgid "Dark theme" +msgstr "Thème sombre" + +#: src/Window.vala:158 +msgid "Toggle light/dark theme" +msgstr "Basculer entre le thème clair/sombre" + +#: src/Window.vala:172 +msgid "Change document font" +msgstr "Modifier la police du document" + +#: src/Window.vala:177 +msgid "Serif" +msgstr "Serif" + +#: src/Window.vala:178 +msgid "Sans-serif" +msgstr "Sans-serif" + +#: src/Window.vala:180 +msgid "Monospace" +msgstr "Monospace" + +#: src/Window.vala:374 +msgid "Save as" +msgstr "Enregistrer sous" + +#: src/Window.vala:387 +msgid "Cancel" +msgstr "Annuler" diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 0000000..df1245b --- /dev/null +++ b/po/meson.build @@ -0,0 +1,11 @@ +# Install main translations +i18n.gettext (meson.project_name (), + args: [ + '--directory=' + meson.source_root (), + '--from-code=UTF-8', + '-cTRANSLATORS' + ], + preset: 'glib' +) + +subdir ('extra') \ No newline at end of file diff --git a/src/application.vala b/src/Application.vala similarity index 92% rename from src/application.vala rename to src/Application.vala index 848daa9..9936061 100644 --- a/src/application.vala +++ b/src/Application.vala @@ -17,16 +17,13 @@ along with this program. If not, see . */ -extern const string APP_ID; -extern const string BUILD_PLATFORM; - public class WriteAs.Application : Gtk.Application { construct { this.flags |= ApplicationFlags.HANDLES_OPEN; Intl.setlocale(LocaleCategory.ALL, ""); Intl.textdomain("write.as"); - application_id = APP_ID + ".desktop"; + application_id = "com.github.writeas.writeas-gtk" + ".desktop"; } public override void activate() { diff --git a/src/Granite/Accels.vala b/src/Granite/Accels.vala index 33eb62a..dd47222 100644 --- a/src/Granite/Accels.vala +++ b/src/Granite/Accels.vala @@ -65,12 +65,12 @@ public static string accel_to_string (string accel) { break; case Gdk.Key.minus: case Gdk.Key.KP_Subtract: - ///TRANSLATORS: This is a non-symbol representation of the "-" key + // TRANSLATORS: This is a non-symbol representation of the "-" key arr += _("Minus"); break; case Gdk.Key.KP_Add: case Gdk.Key.plus: - ///TRANSLATORS: This is a non-symbol representation of the "+" key + // TRANSLATORS: This is a non-symbol representation of the "+" key arr += _("Plus"); break; case Gdk.Key.KP_Enter: @@ -120,7 +120,7 @@ public static string markup_accel_tooltip (string[]? accels, string? description } if (unique_accels.length > 0) { - ///TRANSLATORS: This is a delimiter that separates two keyboard shortcut labels like "⌘ + →, Control + A" + // TRANSLATORS: This is a delimiter that separates two keyboard shortcut labels like "⌘ + →, Control + A" var accel_label = string.joinv (_(", "), unique_accels); var accel_markup = """%s""".printf (accel_label); diff --git a/src/window.vala b/src/Window.vala similarity index 97% rename from src/window.vala rename to src/Window.vala index fe91c6a..6cb5720 100644 --- a/src/window.vala +++ b/src/Window.vala @@ -50,8 +50,8 @@ public class WriteAs.MainWindow : Gtk.ApplicationWindow { size_allocate.connect((_) => {adjust_text_style();}); canvas.event_after.connect((evt) => { - // TODO This word count algorithm may be quite naive - // and could do improvement. + // TODO This word count algorithm may be quite naive and could do improvement. + var word_count = canvas.buffer.text.split(" ").length; header.subtitle = ngettext("%i word","%i words",word_count).printf(word_count); @@ -82,7 +82,7 @@ public class WriteAs.MainWindow : Gtk.ApplicationWindow { stdout.printf("writeas-gtk v%s\n", version); set_application(app); - icon_name = APP_ID; + icon_name = "com.github.writeas.writeas-gtk"; init_folder(); try { open_file(draft_file()); @@ -135,10 +135,7 @@ public class WriteAs.MainWindow : Gtk.ApplicationWindow { header.show_close_button = true; set_titlebar(header); - var icon_size = Gtk.IconSize.SMALL_TOOLBAR; - if (BUILD_PLATFORM == "elementary") { - icon_size = Gtk.IconSize.LARGE_TOOLBAR; - } + var icon_size = Gtk.IconSize.LARGE_TOOLBAR; var publish_button = new Gtk.Button.from_icon_name("document-send", icon_size); @@ -154,8 +151,8 @@ public class WriteAs.MainWindow : Gtk.ApplicationWindow { header.pack_end(publish_button); darkmode_switch = new Granite.ModeSwitch.from_icon_name ("display-brightness-symbolic", "weather-clear-night-symbolic"); - darkmode_switch.primary_icon_tooltip_text = ("Light theme"); - darkmode_switch.secondary_icon_tooltip_text = ("Dark theme"); + darkmode_switch.primary_icon_tooltip_text = _("Light theme"); + darkmode_switch.secondary_icon_tooltip_text = _("Dark theme"); darkmode_switch.tooltip_markup = Granite.markup_accel_tooltip ( {"T"}, _("Toggle light/dark theme") diff --git a/src/meson.build b/src/meson.build index 75de727..da78ee2 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,11 +1,7 @@ -executable(app_id, - 'application.vala', - 'window.vala', +sources = files ( 'Granite/Accels.vala', 'Granite/ModeSwitch.vala', - c_args: ['-include', 'config.h'], - link_args: '-lm', - dependencies: [dependency('gtk+-3.0'), dependency('gtksourceview-3.0')], - install: true + 'Application.vala', + 'Window.vala' )