<?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: Clinton Njiru</title>
    <description>The latest articles on DEV Community by Clinton Njiru (@njiruclinton).</description>
    <link>https://dev.to/njiruclinton</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%2F788314%2F262386ec-5a3c-402b-a657-f2543713c3b0.jpeg</url>
      <title>DEV Community: Clinton Njiru</title>
      <link>https://dev.to/njiruclinton</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/njiruclinton"/>
    <language>en</language>
    <item>
      <title>#Githubhack23 - Lime, a text translation GitHub action</title>
      <dc:creator>Clinton Njiru</dc:creator>
      <pubDate>Sat, 20 May 2023 11:08:24 +0000</pubDate>
      <link>https://dev.to/njiruclinton/githubhack23-lime-a-text-translation-github-action-10gh</link>
      <guid>https://dev.to/njiruclinton/githubhack23-lime-a-text-translation-github-action-10gh</guid>
      <description>&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;I built a GitHub Action called "Lime" that enhances the pull request workflow by automatically translating the text in the readme file to Swahili.&lt;/p&gt;

&lt;h3&gt;
  
  
  Category Submission:
&lt;/h3&gt;

&lt;p&gt;Wacky Wildcards&lt;/p&gt;

&lt;h3&gt;
  
  
  App Link
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/NjiruClinton/Lime"&gt;Github Link&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Screenshots
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FuhPglXm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/53lmo6jv3cm2a4no3g7l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FuhPglXm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/53lmo6jv3cm2a4no3g7l.png" alt="Actions jobs steps" width="800" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--szQ8zMwW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vb40s19ezwxgv4nrb5aj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--szQ8zMwW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vb40s19ezwxgv4nrb5aj.png" alt="Appended translated text" width="800" height="251"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Description
&lt;/h3&gt;

&lt;p&gt;The Lime GitHub Action is designed to streamline the localization process for projects by providing automated translation capabilities for readme files. By leveraging this action, developers can ensure that their project's documentation is accessible to a broader audience, particularly those who prefer Swahili as their primary language.&lt;/p&gt;

&lt;p&gt;The Line action integrates seamlessly into the pull request workflow. When a new pull request is created or an existing one is updated, the action automatically detects the readme file and translates its contents to Swahili using a pre-configured google translation api service. This allows contributors and reviewers to understand the project's documentation in Swahili, facilitating collaboration and inclusion.&lt;/p&gt;

&lt;h3&gt;
  
  
  Link to Source Code
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/NjiruClinton/Lime"&gt;Github Link&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Permissive License
&lt;/h3&gt;

&lt;p&gt;The Line GitHub Action is released under the permissive &lt;a href="https://github.com/NjiruClinton/Lime/blob/main/LICENSE"&gt;MIT License&lt;/a&gt;. This license allows developers to freely use, modify, and distribute the action while providing appropriate attribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;I decided to build the Lime GitHub Action to address the challenge of language localization in open-source projects. It is essential to make software accessible to users from different regions and cultural backgrounds. By providing automated translation capabilities, developers can ensure that their projects are more inclusive and reach a wider audience. Additionally for news related articles and project that need to be done in Swahili.&lt;/p&gt;

&lt;p&gt;The inspiration for this project came from my own experiences as a developer and contributor to open-source projects. I often noticed the lack of localized documentation, which can be a significant barrier for non-English speakers. I wanted to create a solution that simplifies the localization process and encourages project maintainers to provide translations for their documentation effortlessly.&lt;/p&gt;

&lt;h3&gt;
  
  
  How I built it
&lt;/h3&gt;

&lt;p&gt;To build the Lime GitHub Action, I utilized GitHub Actions, a powerful workflow automation tool provided by GitHub. GitHub Actions allows developers to create custom workflows that automatically trigger specific actions in response to events, such as pull requests.&lt;/p&gt;

&lt;p&gt;The core functionality of the Lime GitHub Action is implemented in a JavaScript function. This function leverages the Google Translation API to perform the translation of the readme file's contents. The JavaScript function is called from the workflows YAML file, which defines the steps and triggers for the action.&lt;/p&gt;

&lt;p&gt;Here's a simplified part of the javascript function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;translateText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;readmeContent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sw&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="nx"&gt;then&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Translation: &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="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Append the translated text to the end of the README file&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;translatedReadmeContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;readmeContent&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;\n\nTranslated Text:\n\n&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="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;writeFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;readmePath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;translatedReadmeContent&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;catch&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Error: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Additional Resources/Info
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/NjiruClinton/Lime"&gt;Repository&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cloud.google.com/translate/docs/basic/translate-text-basic"&gt;Google Translation API Documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.github.com/en/actions/quickstart"&gt;GitHub Actions Documentation&lt;/a&gt;&lt;/p&gt;

</description>
      <category>githubhack23</category>
    </item>
    <item>
      <title>[MongoDB Submission Post Placeholder Title]</title>
      <dc:creator>Clinton Njiru</dc:creator>
      <pubDate>Thu, 13 Jan 2022 11:08:07 +0000</pubDate>
      <link>https://dev.to/njiruclinton/mongodb-submission-post-placeholder-title-23e6</link>
      <guid>https://dev.to/njiruclinton/mongodb-submission-post-placeholder-title-23e6</guid>
      <description>&lt;h1&gt;
  
  
  Mongodb atlas hackathon
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Overview of My Submission
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/NjiruClinton/MongoDB-Atlas-hackathon"&gt;Source code&lt;/a&gt;&lt;br&gt;
A small storage site that creates, deletes and edits information in the database&lt;/p&gt;

&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;Edit Quotes and save them in the mongodb database.&lt;/p&gt;

&lt;h3&gt;
  
  
  Link to Code
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/NjiruClinton/MongoDB-Atlas-hackathon"&gt;https://github.com/NjiruClinton/MongoDB-Atlas-hackathon&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Information
&lt;/h3&gt;

&lt;p&gt;Utilizes the &lt;strong&gt;&lt;em&gt;CRUD&lt;/em&gt;&lt;/strong&gt; functions&lt;/p&gt;

</description>
      <category>atlashackathon</category>
    </item>
  </channel>
</rss>
