<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Weblate on widerin</title><link>http://widerin.net/tags/weblate/</link><description>Recent content in Weblate on widerin</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 26 Jul 2020 12:30:34 +0200</lastBuildDate><atom:link href="http://widerin.net/tags/weblate/index.xml" rel="self" type="application/rss+xml"/><item><title>Weblate and i18next json files</title><link>http://widerin.net/posts/2016/weblate-and-i18next-json-files/</link><pubDate>Fri, 29 Apr 2016 00:00:00 +0000</pubDate><guid>http://widerin.net/posts/2016/weblate-and-i18next-json-files/</guid><description>&lt;p&gt;There&amp;rsquo;s a &lt;a href="https://github.com/nijel/weblate/issues/775"&gt;bug report on github&lt;/a&gt; about JSON format breaks &lt;a href="http://i18next.com/"&gt;i18next&lt;/a&gt; files due to automatic restructuring. Actually it flattens your &lt;a href="http://i18next.com/"&gt;i18next&lt;/a&gt; JSON file and makes it unusable for further usage.&lt;/p&gt;
&lt;p&gt;So after starting with a JSON file like:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;{
&amp;#34;navbar&amp;#34;: {
&amp;#34;reward&amp;#34;: &amp;#34;Rewards&amp;#34;,
&amp;#34;about&amp;#34;: &amp;#34;About&amp;#34;
}
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;you end up with a committed file which was transformed into this:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;{
&amp;#34;navbar.reward&amp;#34;: &amp;#34;Rewards&amp;#34;,
&amp;#34;navbar.about&amp;#34;: &amp;#34;About&amp;#34;
}
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="use-weblate-pre_commit_scripts"&gt;Use Weblate PRE_COMMIT_SCRIPTS&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://weblate.org"&gt;Weblate&lt;/a&gt; offers script hooks before or after a repository action happens. I&amp;rsquo;m using &lt;a href="https://docs.weblate.org/en/latest/admin/config.html#std:setting-PRE_COMMIT_SCRIPTS"&gt;one of those hooks&lt;/a&gt; to execute a short &lt;a href="http://www.python.org"&gt;Python&lt;/a&gt; script which reformats JSON again to be usable in &lt;a href="http://i18next.com/"&gt;i18next&lt;/a&gt; translation tools again. The script below is &lt;a href="https://gist.github.com/saily/f8a9f72c6b064d51f09040d66e981240"&gt;also available on Github&lt;/a&gt;:&lt;/p&gt;</description></item><item><title>GitLab as OAuth provider for Weblate</title><link>http://widerin.net/posts/2016/gitlab-as-oauth-provider-for-weblate/</link><pubDate>Thu, 28 Apr 2016 00:00:00 +0000</pubDate><guid>http://widerin.net/posts/2016/gitlab-as-oauth-provider-for-weblate/</guid><description>&lt;p&gt;&lt;a href="http://weblate.org"&gt;Weblate&lt;/a&gt; is built on &lt;a href="https://www.djangoproject.com"&gt;Django&lt;/a&gt; and you can use a lot of authentication plugins.
After &lt;a href="https://github.com/pennersr/django-allauth/pull/1231"&gt;my contribution&lt;/a&gt;
to &lt;a href="https://github.com/pennersr/django-allauth"&gt;django-allauth&lt;/a&gt; and the
backporting work of &lt;a href="https://github.com/python-social-auth/social-core/issues/2"&gt;glensc and omab&lt;/a&gt;
to &lt;a href="https://github.com/python-social-auth/social-core"&gt;django-social-auth&lt;/a&gt; it&amp;rsquo;s very easy
to integrate [GitLab]&amp;rsquo;s &lt;a href="http://doc.gitlab.com/ce/integration/oauth_provider.html"&gt;authentication provider&lt;/a&gt;
with &lt;a href="http://weblate.org"&gt;Weblate&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="gitlab"&gt;GitLab&lt;/h2&gt;
&lt;p&gt;All you have to do on &lt;a href="http://about.gitlab.com"&gt;GitLab&lt;/a&gt; is configuration
through webinterface. Go to &lt;a href="https://gitlab.com/profile/applications"&gt;https://gitlab.com/profile/applications&lt;/a&gt;
and register a new application.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Name: Weblate&lt;/li&gt;
&lt;li&gt;Redirect URI: `&lt;a href="https://weblate.yourdomain.tld/accounts/complete/GitLab/%60%60"&gt;https://weblate.yourdomain.tld/accounts/complete/GitLab/``&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;figure itemprop="associatedMedia" itemscope itemtype="https://schema.org/ImageObject"&gt;
&lt;a class="glightbox" href="http://widerin.net/posts/2016/weblate_gitlab_register_application.png" data-gallery="gallery-page" itemprop="contentUrl"&gt;
&lt;img loading="lazy" src="http://widerin.net/posts/2016/weblate_gitlab_register_application.png" alt="" itemprop="thumbnail"&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;After registering your new application you&amp;rsquo;ll get your &lt;strong&gt;Application
Key&lt;/strong&gt; and &lt;strong&gt;Secret&lt;/strong&gt;. You&amp;rsquo;ll need this later for configuration&lt;/p&gt;</description></item></channel></rss>