<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Netanel Basal</title>
    <description>The latest articles on DEV Community by Netanel Basal (@netanelbasal).</description>
    <link>https://dev.to/netanelbasal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F155551%2F107a0000-2b64-49cd-a697-676eea9270b0.jpeg</url>
      <title>DEV Community: Netanel Basal</title>
      <link>https://dev.to/netanelbasal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/netanelbasal"/>
    <language>en</language>
    <item>
      <title>🚀 The Ultimate Monorepo Starter for Node.js Serverless Applications</title>
      <dc:creator>Netanel Basal</dc:creator>
      <pubDate>Wed, 11 May 2022 05:16:56 +0000</pubDate>
      <link>https://dev.to/netanelbasal/the-ultimate-monorepo-starter-for-nodejs-serverless-applications-3k6l</link>
      <guid>https://dev.to/netanelbasal/the-ultimate-monorepo-starter-for-nodejs-serverless-applications-3k6l</guid>
      <description>&lt;p&gt;I am happy to announce the release of "The Ultimate Monorepo Starter for Node.js Serverless Applications."&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;p&gt;✅ First-Class Typescript Support&lt;br&gt;
✅ DynamoDB Single Table Design&lt;br&gt;
✅ Shared API Gateway&lt;br&gt;
✅ Environments Configuration&lt;br&gt;
✅ JWT Auth Middleware&lt;br&gt;
✅ Http Params Validation&lt;br&gt;
✅ Typed Proxy Handlers&lt;br&gt;
✅ Auto Generators&lt;br&gt;
✅ Localstack&lt;br&gt;
✅ ESLint&lt;br&gt;
✅ Jest&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/ngneat/nx-serverless"&gt;https://github.com/ngneat/nx-serverless&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>lambda</category>
      <category>node</category>
      <category>javascript</category>
    </item>
    <item>
      <title>🚀 Introducing Transloco: Angular Internationalization Done Right</title>
      <dc:creator>Netanel Basal</dc:creator>
      <pubDate>Mon, 19 Aug 2019 05:35:42 +0000</pubDate>
      <link>https://dev.to/netanelbasal/introducing-transloco-angular-internationalization-done-right-3hh7</link>
      <guid>https://dev.to/netanelbasal/introducing-transloco-angular-internationalization-done-right-3hh7</guid>
      <description>&lt;p&gt;Originally published at &lt;a href="https://netbasal.com/introducing-transloco-angular-internationalization-done-right-54710337630c"&gt;netbasal.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For a while I've been thinking about creating an Angular i18n library, which incorporates some concepts I had in mind.&lt;/p&gt;

&lt;p&gt;A couple of weeks ago I was bored 😀, so I decided that's it time to take the bull by the horns and go ahead and create a robust library, chock-full of all the features I'd expect from such a library.&lt;/p&gt;

&lt;p&gt;I recruited Shahar Kazaz and Itay Oded to the task; Together, we worked hard over the weeknights, and that's how &lt;a href="https://github.com/ngneat/transloco"&gt;Transloco&lt;/a&gt; was born.&lt;/p&gt;

&lt;p&gt;I've also created the ng-neat organization, to hold all my open source libraries. Currently it only holds Transloco, but I also plan to transfer &lt;a href="https://github.com/NetanelBasal/spectator"&gt;Spectator&lt;/a&gt;, &lt;a href="https://github.com/NetanelBasal/ngx-take-until-destroy"&gt;ngx-until-destroy&lt;/a&gt;, ngx-content-loader, and any future open-source Angular libraries I create.&lt;/p&gt;

&lt;p&gt;Let's take a look at what Transloco has to offer.&lt;/p&gt;

&lt;p&gt;Install the library using Angular CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng add @ngneat/transloco
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YzGZMBA3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/2600/1%2ARnSX-ybFkKsUYEawHDWJHQ.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YzGZMBA3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/2600/1%2ARnSX-ybFkKsUYEawHDWJHQ.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As part of the installation process you'll be presented with questions; Once you answer them, everything you need will automatically be created for you. Let's take a closer look at the generated files.&lt;/p&gt;

&lt;p&gt;First, Transloco creates boilerplate files for the requested translations:&lt;/p&gt;

&lt;p&gt;assets/i18n/en.json&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hello"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"transloco en"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"dynamic"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"transloco {{value}}"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;assets/i18n/es.json&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hello"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"transloco es"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"dynamic"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"transloco {{value}}"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Next, it injects the &lt;code&gt;TranslocoModule&lt;/code&gt; into the &lt;code&gt;AppModule&lt;/code&gt;, and sets some default options for you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;TRANSLOCO_CONFIG&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;TranslocoModule&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@ngneat/transloco&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;HttpClientModule&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@angular/common/http&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;httpLoader&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./loaders/http.loader&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;environment&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../environments/environment&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;NgModule&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;imports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;TranslocoModule&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;HttpClientModule&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;providers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;httpLoader&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;provide&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;TRANSLOCO_CONFIG&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;useValue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;prodMode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;production&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;listenToLangChange&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;defaultLang&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;en&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;bootstrap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;AppComponent&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;AppModule&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Let's explain each one of the config options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;listenToLangChange&lt;/code&gt;: Subscribes to the language change event, and allows you to change the active language. This is not needed in applications that don't allow the user to change the language in runtime (i.e., from a dropdown), so by setting it to false in these cases, you can save on memory by rendering the view once, and unsubscribing from the language changes event (defaults to false)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;defaultLang&lt;/code&gt;: Sets the default language&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;fallbackLang&lt;/code&gt;: Sets the default language/s to use as a fallback&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;failedRetries&lt;/code&gt;: How many time should Transloco retry to load translation files, in case of a load failure (defaults to 2)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also injects the httpLoader into the &lt;code&gt;AppModule&lt;/code&gt; providers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;HttpClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@angular/common/http&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Translation&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;TRANSLOCO_LOADER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;TranslocoLoader&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@ngneat/transloco&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Injectable&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@angular/core&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Injectable&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;providedIn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;HttpLoader&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;TranslocoLoader&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nx"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;HttpClient&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

  &lt;span class="nx"&gt;getTranslation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;langPath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Translation&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/assets/i18n/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;langPath&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.json`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;httpLoader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;provide&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;TRANSLOCO_LOADER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;useClass&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;HttpLoader&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;HttpLoader&lt;/code&gt; is a class that implements the &lt;code&gt;TranslocoLoader&lt;/code&gt; interface. It's responsible for instructing transloco how to load the translation files. It uses Angular HTTP client to fetch the files, based on the given path.&lt;/p&gt;

&lt;h2&gt;
  
  
  Translation in the Template
&lt;/h2&gt;

&lt;p&gt;Transloco provides three ways to translate your templates:&lt;/p&gt;

&lt;h3&gt;
  
  
  Using the Structural Directive
&lt;/h3&gt;

&lt;p&gt;This is the recommended approach. It's DRY and efficient, as it creates one subscription per template:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;ng-container&lt;/span&gt; &lt;span class="na"&gt;*transloco=&lt;/span&gt;&lt;span class="s"&gt;"let t"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;{{ t.home }}&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;{{ t.alert | translocoParams: { value: dynamic } }}&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/ng-container&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Using the Attribute Directive
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;transloco=&lt;/span&gt;&lt;span class="s"&gt;"home"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;transloco=&lt;/span&gt;&lt;span class="s"&gt;"alert"&lt;/span&gt; &lt;span class="na"&gt;[translocoParams]=&lt;/span&gt;&lt;span class="s"&gt;"{ value: dynamic }"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;[transloco]=&lt;/span&gt;&lt;span class="s"&gt;"key"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Using the Pipe
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;{{ 'home' | transloco }}&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt; 
&lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;{{ 'alert' | transloco: { value: dynamic } }}&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Programmatical Translation
&lt;/h2&gt;

&lt;p&gt;Sometimes you may need to translate a key in a component or a service. To do so, you can inject the TranslocoService and use its translate method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;AppComponent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;TranslocoService&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

  &lt;span class="nx"&gt;ngOnInit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;world&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;key&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;en&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;translate&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;translate&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;someKey&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  😱 But Wait - There's More!
&lt;/h2&gt;

&lt;p&gt;This was just a taste of Transloco, it also supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;😴 Lazy Loading&lt;/li&gt;
&lt;li&gt;😍 Multiple Languages&lt;/li&gt;
&lt;li&gt;🔥 Multiple Fallbacks&lt;/li&gt;
&lt;li&gt;🤓 Testing&lt;/li&gt;
&lt;li&gt;🦊 Fully customizable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find everything you need, along with examples, in our official README file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Migration from ngx-translate
&lt;/h2&gt;

&lt;p&gt;Transloco provides a schematics command that will help you with the migration process. Check out the comparison &lt;a href="https://github.com/ngneat/transloco/#comparison-to-other-libraries"&gt;table&lt;/a&gt; for more information.&lt;/p&gt;

&lt;p&gt;Happy translating, and don't forget to show your appreciation by starring!&lt;/p&gt;

&lt;p&gt;⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️&lt;/p&gt;

</description>
      <category>angular</category>
      <category>i18n</category>
      <category>internationalization</category>
    </item>
    <item>
      <title>Start Writing About Code: The Why and How</title>
      <dc:creator>Netanel Basal</dc:creator>
      <pubDate>Wed, 12 Jun 2019 09:47:16 +0000</pubDate>
      <link>https://dev.to/netanelbasal/start-writing-about-code-the-why-and-how-4aa9</link>
      <guid>https://dev.to/netanelbasal/start-writing-about-code-the-why-and-how-4aa9</guid>
      <description>&lt;p&gt;This article was originally published in &lt;a href="https://netbasal.com/start-writing-about-code-the-why-and-how-49b27f9ec366"&gt;netbasal.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In over three years of writing, and having written over 120 articles, I have decided to share with you some tips I have learned along the way to help those who wish to start writing or are already in the process of writing.&lt;/p&gt;

&lt;p&gt;Before we begin, I would like to point out some reasons why one should start writing in the first place.&lt;/p&gt;

&lt;h2&gt;
  
  
  🤔 Why You Should Start a Blog
&lt;/h2&gt;

&lt;p&gt;The first reason being that one of the things that cause developers satisfaction, is knowing that the information they share has helped someone else.&lt;/p&gt;

&lt;p&gt;A second reason is that writing an article requires a deep understanding of its content, so in the process of doing so, we become more professional.&lt;/p&gt;

&lt;p&gt;The third reason is that my articles are my reference whenever I need to develop a new feature or solve a bug whenever I've forgotten how to do so.&lt;/p&gt;

&lt;p&gt;The last reason is the ability to create a name for yourself in the community, which is a nice thing in and of itself.&lt;/p&gt;

&lt;p&gt;Hopefully, by now you're convinced you should start writing, so allow me to give you some tips:&lt;/p&gt;

&lt;h2&gt;
  
  
  ✌️Don't Give Up
&lt;/h2&gt;

&lt;p&gt;One of the common responses I get from people who start writing is "I only had 20 views", or "I only got one like."&lt;/p&gt;

&lt;p&gt;Let me tell you something: It took me three years of writing to get to where I am today. If you do not keep moving forward and creating useful materials, it will stay that way. You mustn't give up.&lt;/p&gt;

&lt;h2&gt;
  
  
  📤 Share Your Articles
&lt;/h2&gt;

&lt;p&gt;In order to get to know you, especially at the beginning of your journey, it's important to publish the articles you create wherever possible.&lt;/p&gt;

&lt;p&gt;Share them on Facebook groups, LinkedIn, Twitter, or any other relevant place. If you don't do that, the chances of readers being introduced to them are very slim. Once you have enough followers, you can skip this part.&lt;/p&gt;

&lt;h2&gt;
  
  
  👮 Choose Your Content Wisely
&lt;/h2&gt;

&lt;p&gt;A crucial decision to make is what your articles should be about. The articles that get the most views are those that solve a problem for a large number of people. Try to offer unique content to the reader, and avoid writing about obvious things.&lt;/p&gt;

&lt;h2&gt;
  
  
  🤓 Select a Good Title
&lt;/h2&gt;

&lt;p&gt;The article title is one of the most important decisions you'll make, for two reasons: First, a good headline attracts more readers; Second, a good headline will show up in many relevant search results.&lt;/p&gt;

&lt;p&gt;Always think about what the reader would write in the search input, and build the title based on that. Your article's exposure will be much more significant if it's on the first page of Google search results.&lt;/p&gt;

&lt;h2&gt;
  
  
  😟 "But English Isn't My Native Language"
&lt;/h2&gt;

&lt;p&gt;Unfortunately, there are a lot of very talented people who want to share their knowledge but are deterred from doing so, because English is not their native language.&lt;/p&gt;

&lt;p&gt;But at the end of the day, we all speak one language: &lt;b&gt;code&lt;/b&gt;. Even if you're not the most articulate English speaker, don't be shy, just write. If the title is good and the code is interesting, people will understand. So don't worry too much about it.&lt;/p&gt;

&lt;p&gt;Personally, I have often encountered technical articles written in various languages, such as Russian or Chinese. I saw an interesting title, ran Google translate, and learned a few things from them.&lt;/p&gt;

&lt;p&gt;Furthermore, these days you can get online proofreading services for a small amount of money. So the bottom line is, do not let that deter you. The more you write, the better your English will become.&lt;/p&gt;

&lt;h2&gt;
  
  
  💪 Improve Your Writing Skills
&lt;/h2&gt;

&lt;p&gt;Learn from others: The only way to get better at writing is to read other people's technical books and articles. Pay attention to their methods, opening sentences, and styles of writing. Then see how your writing can improve as a result.&lt;/p&gt;

&lt;h2&gt;
  
  
  👂 Get Feedback
&lt;/h2&gt;

&lt;p&gt;Ask for feedback from as many of your co-workers and colleagues as possible. I'm sure you understand what you've written, but that doesn't necessarily mean it's evident to others.&lt;/p&gt;

&lt;h2&gt;
  
  
  😞 ״But Someone's Already Written About It״
&lt;/h2&gt;

&lt;p&gt;If someone has already written about a particular subject, that doesn't mean you shouldn't write about it either. There is a chance that readers will benefit from your explanation and examples.&lt;/p&gt;

&lt;h2&gt;
  
  
  ✋ Ignore Rude Comments
&lt;/h2&gt;

&lt;p&gt;Along the way, people will comment on your articles. Some of those responses might be rude; My advice is simply to ignore them, and not to take them personally.&lt;/p&gt;

&lt;h2&gt;
  
  
  ✍️ Tips for Writing:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Keep it simple. Try to avoid complicated phrases. People love to read clear and concise language. Most importantly, be yourself.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's better to write one long article than divide it into several parts. The reader can stop at any point and get back to it, so you don't have anything to worry about.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Try to have a fair amount of code and text - I encounter many articles that have lots of text but very little code, or vice versa. In many cases, it discourages the readers and they abandon the article.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a proper division into paragraphs, add punctuation marks and periods where necessary.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using emojis is always lovely and valuable 🦄&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When possible, before you go into the technical parts, show the readers an illustrated example of what you're going to create. Use an image, gif, or any other means. There's a chance that this is what will attract readers and keep them reading on.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When you add a code section to an article, make sure it's nicely formatted.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Don't add code blocks as images. It is very annoying and prevents people from being able to copy the code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Try to add the final result at the end of the article, whether it's via a Github repo or something like Stackblitz.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hope these tips helped inspire you… now go write 😎&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>code</category>
      <category>blog</category>
      <category>write</category>
    </item>
  </channel>
</rss>
