<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Paul Zaich on Medium]]></title>
        <description><![CDATA[Stories by Paul Zaich on Medium]]></description>
        <link>https://medium.com/@pzaich?source=rss-91507aed0cf6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*5_iqDNTXdCPvWL1q.jpg</url>
            <title>Stories by Paul Zaich on Medium</title>
            <link>https://medium.com/@pzaich?source=rss-91507aed0cf6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 07:32:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pzaich/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Sounds of Silence: Lessons From an API Outage]]></title>
            <link>https://medium.com/checkr/the-sounds-of-silence-lessons-from-an-api-outage-988ac5027e15?source=rss-91507aed0cf6------2</link>
            <guid isPermaLink="false">https://medium.com/p/988ac5027e15</guid>
            <category><![CDATA[postmortem]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[incident-response]]></category>
            <dc:creator><![CDATA[Paul Zaich]]></dc:creator>
            <pubDate>Mon, 29 Jun 2020 19:06:22 GMT</pubDate>
            <atom:updated>2021-10-27T21:09:24.285Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GQpt1W_5zPX7fu02" /></figure><p><em>This article is a written version of the talk “The Sounds of Silence: Lessons from an 18 hour API outage” presented at RailsConf 2020.2 Couch Edition. You can watch the video </em><a href="https://www.youtube.com/watch?v=bSPvuaFtN6M"><em>here</em></a><em>.</em></p><p>Bugs are the constant companion of an engineer. Anytime change is introduced to a complex system, no matter how strict the quality controls and tooling, there’s a chance human error will introduce a bug. Let’s face it: bugs are a reality of software development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/312/0*XtlVcnKsrKdvUvG0" /><figcaption><a href="https://imgs.xkcd.com/comics/fixing_problems.png">https://imgs.xkcd.com/comics/fixing_problems.png</a></figcaption></figure><p>So if bugs are inevitable, the question is “how do we reduce their impact?” In this article I’ll share the details of an outage at Checkr in 2017, the steps that we took as a result of the incident, and share general lessons around metric monitoring that can help you maintain a healthy web application.</p><h3>The Incident</h3><p>In 2017 on October 6th, Checkr experienced an 18 hour partial API outage where some customers were unable to create reports using our REST API. At the time the Checkr engineering team consisted of 30 engineers across 6 teams. Request volume had grown significantly over just a few years and much of the team’s focus at the time was on stabilizing the system to handle the increased load. The team had doubled in the previous year and much of the knowledge of the system was held informally by members of the team.</p><p>In the Checkr system, a Report is the model that describes a Checkr background check. The report represents the legal document that is delivered to the customer when completed. It also governs many associated screenings responsible for fetching and parsing data. Each screening or search we execute is associated back to the Report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wKJj93nW__Gxy8xd" /></figure><p>Customers initiate a background check with Checkr by making a HTTP request to the Checkr reports REST API. Checkr creates the report record synchronously and completes the report through a series of asynchronous processes. You can read more about the challenges of managing the complexity of the background check process <a href="https://medium.com/checkr/building-software-to-manage-the-complexities-of-background-checks-35ab83bf6e75">here</a>.</p><h3>Timeline</h3><p>The incident began at 4:30pm on a Friday afternoon. A script was run to migrate some old screening records from an integer foreign_key to use a UUID instead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u4Uw1r_MBN7bEDlB" /></figure><p>Within an hour, by 5:30pm, an on-call engineer on an unrelated team was paged because of a spike of errors on one of our frontend applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fDbMSwDWaNSWkRMJ" /></figure><p>The application submitted a small percentage of our total volume of reports and did not use the main API used by customers. Upon initial investigation, the responder decided that the error was likely the result of user error. They snoozed the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8B-mSYnctbZ9Izqj" /></figure><p>Early on Saturday morning, the same error triggered another page. The on-call engineer began investigating the error and eventually noticed a strange status code being returned by our reports#create endpoint.</p><p>The public and private report endpoints were returning 404s for many but not all requests. At this point around 9:30am, it was finally clear that there was a major problem that impacted our apis, not just the client application.</p><p>The initial responder escalated the issue to get all on-call engineers involved. With a smaller engineering team, escalation via Slack worked well. They pinged the #eng-fire channel and the rest of the team started to login to our VPN. I remember pulling my laptop in the parking lot of Crissy Field park.</p><p>The surge in traffic took our VPN down. We needed to go to the office to access the intranet and production servers to investigate.</p><p>Finally, we made it into the office around 10am. Now with full access to request logs within an hour, the issue had been reproduced.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_NCrjX0pPocYJ_oq" /></figure><p>A hot fix was quickly implemented within 15 minutes to patch the immediate issue.</p><h3>Postmortem</h3><p>At Checkr we strive for a blameless culture where we learn from our mistakes and make improvements as a result of outages. An important part of that process for us is creating a Postmortem document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*onmhCJ03INKdMMxha2qp-g.png" /></figure><p>The Postmortem document and process has evolved over time as the team has grown, but the goal remains the same — to learn from the incident so that the same mistake does not happen again. The postmortem document captures the root cause, timeline, and action items. Identifying the root cause is an important component of the postmortem, but follow up action items are even more important. Here’s what we learned.</p><h3>Lessons Learned: Corrupted Database Entries</h3><p>The root cause was exposed due to the backfill run at the start of the incident. The associated records and database level constraints were not enforced. This was in part due to the use of two different databases for storing reports and the screenings. As a result, we could not add stricter database constraints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SpBnkEXJ1it2HW2b" /></figure><p>The backfill corrupted records in our database; Our table relationships assumed that foreign keys would always been present. As a result, some screenings ended up with a nullified reference to their parent report and had a null value for report_id.</p><p>When a new report was validated by ActiveRecord validations, the report ensures that it’s associated screenings are valid given the configuration of the report and the information provided about the candidate. A screening object is found in the database or built in memory. Since the report_id of the new report was null, the nullified screenings were found as a result. When the validation was called on the screening, the screening’s foreign key was used to look up the report. In this case, the report could not be found and an ActiveRecord::NotFound exception was raised. Our API routes handle ActiveRecord::NotFound automatically and return a 404 response.</p><pre><strong>class</strong> <strong>Report</strong><br>  <strong>def</strong> <strong>get_screening</strong>(klass)<br>    klass.find_by(report_id: )<br>  <strong>end</strong><br><strong>end</strong></pre><pre>…</pre><pre><strong>class</strong> <strong>Screening</strong><br>  validate :candidate_field_format</pre><pre><strong>  def</strong> <strong>report</strong><br>   Report.find(report_id)<br>  <strong>end</strong></pre><pre><strong>  def</strong> <strong>candidate_field_format</strong><br>     validate_field(report.candidate.field)<br>   <strong>end</strong><br>  <strong>end<br>end</strong></pre><p>The backfill only impacted two of our screening tables. As a result, some types of reports continued to create successfully while others didn’t. This turned out to be a contributing factor in our overall incident response because not all report types were impacted.</p><h3>Lessons Learned: Slow Response Time</h3><p>The second problem we identified was the 14 hour lag in response time from the start of the incident.</p><p>This timeline can be broken into two buckets: the Time to Resolution and the Time to Response. In this incident, the Time to Response severely impacted the overall duration of the degraded report API. 75% of the incident’s duration occurred before an active response was initiated. Every hour of additional downtime was a multiplier in terms of impacted API requests. We asked ourselves what would have alerted us to the issue sooner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NRuQv6LKsUKa85oR" /></figure><p>Remember, we were paged within an hour of the start of the incident. But the alert was far removed from the impacted component of the application. The error was in an entirely different repository, the alert pointed to a frontend service and the service utilized an internal api that received only a small percentage of our overall report traffic. The alert from Sentry was better than nothing but it didn’t contain clear, actionable information that a responder could use to make an informed decision and assessment of the problem.</p><p>Here’s the most painful part of this incident from a response perspective. We had a monitor specifically setup for the express purpose of detecting an outage in report creation. We captured a statsD event every time a new report was created in the system. This was exactly what we needed!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ksHO_d8dmUmR8mNz" /><figcaption><strong>report.created</strong> count never fell below our minimum threshold</figcaption></figure><p>The problem was that our alerting rules were far too simplistic to detect more subtle failures. When the monitor was setup, we made the assumption that we’d see close to 100% of reports failing to create. As a result we had set a constant threshold floor of 100 reports created in 30 minutes. If the rate dropped below that threshold, an alarm would sound.</p><p>The outage did not impact all reports. Only certain report configurations were impacted. As a result we saw the report creation metric drop abnormally low but it never dipped below our floor value during the incident. The monitor was not sensitive enough to detect the issue. This incident highlighted that we needed to improve the overall observability of our critical systems.</p><h3>Improving observability</h3><p>By definition, <strong>Observability</strong> is a measure of how well internal states of a <a href="https://en.wikipedia.org/wiki/System">system</a> can be inferred from knowledge of its external outputs. In this next section, I’ll explore tools for improving overall observability in your application, how those tools work together, and how to use those tools to craft meaningful alerts when something goes wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YOpT_qBK8iU_1lgt" /></figure><p>There are three key components to building an observability stack. First, you need to need mechanisms for gathering metrics, measurable events that indicate something about the state of your system. Second, you need to define monitoring rules that define when a particular metric is green or red. Third, your monitoring rules should be connected to an incident management platform that governs rules around on-call responders and escalation. Do not use email or Slack as your primary notification method!</p><h3>Metric Collection</h3><p>Let’s talk a bit about metric collection. There are three broad categories of metric collection common in web applications. There are many stacks and solutions that can address one or more of these categories.</p><p>One of the most common types of metric collection are Exception Trackers. These are services that provide libraries to capture events when exceptions occur in your application. Examples include Sentry, Rollbar, and Airbrake.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tU6pxl7x_6ugwNXO" /></figure><p>Another common type of metric collection is Application Performance monitoring or APM. APM gives you access to industry standard metrics across common protocols and stacks. The benefit of APM is that you get a wealth of generic metrics for free. You can easily drill down to see request volume, latency, or investigate a full trace from the application, to the database and back.</p><p>The final category is real-time custom application metric collection. These are metrics implemented by the engineer to describe a specific business process performed by your application. These metrics are the hardest to define and maintain but give you direct visibility.</p><p>To visualize the kind of visibility that each of these metrics gives to you. Let’s imagine that your application is a black box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gAaN9I5SrdcoffbP2f50NA.png" /></figure><h4>Exception Tracking</h4><p>Exception tracking will give you targeted insights into hotspots in your application. It will give you a sense of the impact and frequency of the error and a location where the exception is being triggered (via stack trace). Depending on the size of the application and an engineer’s amount of context, it may or may not be clear what the impact of the exception is. As we saw earlier exception events eventually triggered a response to the incident, but it wasn’t immediately clear what if anything was wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GMurX7LNHCB4w2CsWgdZLw.png" /></figure><h4>Application Performance Monitoring (APM)</h4><p>I like to think of APM as a heat-map overlaid over your application. It’s possible to zoom in on a specific part of the application but it also gives you a high-level view of the overall health of your application. It’s very useful for identifying system-wide outliers that might indicate a problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W4Dkr3b4wxcqKyXXl7TYgQ.png" /></figure><p>APM often comes in handy when you haven’t anticipated a specific mode of failure. A recent example of that occurred for us back in February. A configuration change was made that impacted the ability of several services in our stack from authenticating with each other. As we saw some more targeted metrics begin to trend in the wrong direction, the spike in 401s in our applications made it clear that something was wrong with authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TBOQq3BcHQEOI55e3rdMcA.png" /></figure><h4>Custom Metrics</h4><p>Custom metrics give you, the engineer, a way of describing the health of a specific feature or component in your application. You can view each of these components as distinct units using the telemetry generated by the metric. As a result, the engineer has health metrics that correlate closely to specific components or systems within the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2NubWu2G6NoSxGRchYHGHA.png" /></figure><h3>Monitoring your metrics</h3><p>Once you have metrics, you have the raw data to identify when intervention is needed, but you still need to define rules that determine when something isn’t healthy. What marks a good monitor?</p><p><strong>High Fidelity </strong>— it needs to be a trusted measure of system health. You don’t want to miss true positives that indicate a problem but you also don’t want an overly sensitive monitor that constantly alerts on false positives. False positives degrade confidence in the alarm and lead to responder fatigure. When a real alarm is triggered, it’s possible the responder will simply ignore the alert.</p><p><strong>Targeted — </strong>In most cases, it’s best to define monitors that measure the health of a discrete feature or component. A more narrowly defined monitor will give the responder actionable information that will make a response quicker or more effective.</p><p><strong>Leading vs Lagging — </strong>Finally, ideally the indicator should be a leading indicator rather than a lagging one. For example, at Checkr, we also measure report completion to ensure as another metric. This metric would not be a good indicator of the health of report creation however because reports can take several hours to complete.</p><p>Recall that our monitor failed due to a lack of sensitivity. Let’s talk about a few types of monitor patterns that could have helped us be alerted much sooner in our incident.</p><h4>Composite Monitors</h4><p>First let’s talk about composite monitors. The concept is pretty straightforward: tie multiple metrics together as a combined signal. We ultimately added a composite monitor as part of our followup actions as a response to this incident. By measuring some additional critical sub-components, we had better visibility into overall system health. We combined measurements that looked at both report creation and individual screening creation to spot issues where a specific screening was causing report failures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IZtPxhl4H8MJiHyY" /></figure><h4>Rate Monitors</h4><p>One way is to make our measurements to make our monitoring rules more resilient to fluctuations while maintaining sensitivity is to use rates instead of raw values. A rate monitor measures 2 metrics relative to each other. Absolute metrics do not handle changes in overall metric volume well. That’s one of the reasons why our original metric monitor failed; it handled fluctuations in the metric by having a very low sensitivity to failure. Measuring the report created count against the total number of report creation attempts gives you a metric that easily adapts to spikes and dips in overall request volume.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y_sCrjT44LNBfHWK" /></figure><h4>Anomaly Detection</h4><p>Another option is to use a more sophisticated algorithm to measure the raw values; Datadog’s anomaly detection monitor uses machine learning and statistical models to model your metrics. Anomaly detection gives you the ability to detect outliers in your metric over time. This method allows you to apply statistical methods like standard deviation to account for variability and define a constantly re-fitted bounds rather than defining rules against absolute values. This type of monitor has the benefit of adjusting over time as your metric’s patterns change accounting for seasonality and long-term trends.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fc6fSJznlpqXL7wRaXwUPA.png" /></figure><p>In practice, we’ve found these monitors to be overly sensitive (creating false positives) even when allowing for more flexible bounding and up to this point we have not used anomaly detection as a core piece of our alerting rules.</p><h3>Building observability into your culture</h3><p>Let’s talk about how these metrics can work together in a growing business. Let’s pretend that we’ve started our own e-commerce store to support a brand new box business. When you are first starting out, your traffic is very low and you have a small team that understands the full system. It’s likely that when an exception occurs, you will know pretty quickly what and why an error has occurred. Traffic is inconsistent so it’s hard to predict how many boxes will be purchased or how many shoppers will be interacting with your store.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SUyu0sikJApRAPI3" /></figure><p>As your store grows, it becomes harder to understand how everything works together. You added new features to your product page and recently added coupon codes to checkout. How do you know that your core store features are working? That’s where Custom metrics start to shine. You can start to instrument higher volume events like “Add to Cart” first.</p><p>As traffic continues to grow, you can add other critical features as discretely monitored events.</p><p>Start small when it comes to implementing custom metrics. Do not try to measure everything. Prioritize parts of your system that are critical for the business:</p><ul><li>What would I want to know before my customer notices? Target monitoring in places where you are delivering the most value to your customers.</li><li>What systems are most brittle (due to technical debt or other factors) and at risk of breaking?</li></ul><p>As your system explains, introduce more structure. Consider defining the importance of specific services or components more explicitly and mapping requirements including monitoring and on-call to those tiers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s5Z3EdDGsZnT7VAk01FlsQ.png" /><figcaption>Example service definitions</figcaption></figure><p>Bugs are an inevitable part of the software development cycle. A robust testing automated and manual testing will reduce the number of bugs deployed to production. The goal after deployment should be to mitigate the impact of these bugs with a faster and more proactive incident response. Observability is the foundation for maintaining reliable systems to improve incident response when systems fail.</p><p><strong>Start small</strong>. Turn-key tools like Exception Trackers and APM provide a huge amount of value with limited investment.</p><p><strong>Measure things that are critical to your application.</strong> Don’t try to measure everything.</p><p><strong>Iterate on your monitoring rules</strong>. Tune them to ensure that alerts high fidelity and actionable for your responders.</p><p><strong>Continually set the quality bar higher as you grow. </strong>Keep holding your services to higher and higher observability standards higher as traffic and complexity grow. New requirements should be added over time and more requirements should filter down the service tiers. A requirement for Tier 1 services should eventually become the norm for lower tiers.</p><p><em>This article is a written version of the talk “The Sounds of Silence: Lessons from an 18 hour API outage” presented at RailsConf 2020.2 Couch Edition. You can watch the video </em><a href="https://railsconf.com/2020/video/paul-zaich-the-sounds-of-silence-lessons-from-an-18-hour-api-outage"><em>here</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=988ac5027e15" width="1" height="1" alt=""><hr><p><a href="https://medium.com/checkr/the-sounds-of-silence-lessons-from-an-api-outage-988ac5027e15">The Sounds of Silence: Lessons From an API Outage</a> was originally published in <a href="https://medium.com/checkr">Checkr Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using dynamic localization to improve Accessibility with React and Redux]]></title>
            <link>https://medium.com/checkr/using-dynamic-localization-to-improve-accessibility-with-react-and-redux-7650878af6ef?source=rss-91507aed0cf6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7650878af6ef</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[localization]]></category>
            <dc:creator><![CDATA[Paul Zaich]]></dc:creator>
            <pubDate>Thu, 27 Jul 2017 20:13:31 GMT</pubDate>
            <atom:updated>2017-07-27T20:13:31.362Z</atom:updated>
            <content:encoded><![CDATA[<p>Due to the sensitive legal requirements established by the FCRA (Fair Credit Reporting Act) which protects the rights of applicants in our industry, we take compliance very seriously. Each time an applicant authorizes <a href="https://checkr.com/">Checkr</a> to perform a background check on behalf of a client, a legal document is created on their behalf. Ensuring that these authorization documents are accurate is a critical part of our compliance effort. Making these authorization documents easy to read and understand aligns directly with Checkr’s mission to build a fairer future. As part of our recent redesign of this authorization flow, we targeted adding full localization support to ensure that non-native English speakers have an equally accessible experience and can complete the authorization in their preferred language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*mQ-HNi1CJGf_bkg0eAlTvA.png" /><figcaption><a href="https://xkcd.com/850/">https://xkcd.com/850/</a></figcaption></figure><h3>Background</h3><p>Previously localization had been implemented in a haphazard approach due to incremental changes in scope and pressures in delivery timeline. Each template or view was re-implemented in the supported languages (English and Spanish) across several different applicant workflows. This had several drawbacks:</p><ul><li><strong>Duplication</strong>: Components (and associated logic) were often implemented twice. This made updates to our components or implementing new features expensive and it was easy for engineers to mistakenly forget to update views in other languages. Furthermore, some workflows did not support localization at all.</li><li><strong>Visibility for legal review: </strong>Since all legal text was embedded directly into HTML views, it was difficult to make copy directly accessible for review outside the engineering team.</li></ul><p>Creating an extensible localization pattern for the Checkr application flow has enabled us to quickly add additional language and feature support , <a href="https://en.wikipedia.org/wiki/Don%27t_repeat_yourself">DRY</a> up our component logic and streamlined the review process with our legal team.</p><h3>How our localized text gets generated</h3><p>Localization is slightly more complicated than a simple change to static text rendered in HTML. Checkr/apply renders internationalized text from 2 different sources:</p><ul><li><strong>Static copy</strong>: Rendered and stored by the Client application.</li><li><strong>Custom Configurable text</strong>: Returned by the API that pertains to particular clients, types of background checks and the location of the applicant. For instance, New York City requires specific types of disclosures when authorizing a credit check. In other cases, clients require custom legal disclosures provided by their in-house compliance team.</li></ul><h3>Simple state change triggers a change in translation</h3><p>Under the hood Checkr/apply uses a simple Redux store to store translations via the <a href="https://github.com/zoover/react-redux-i18n">react-redux-i18</a> npm package.</p><p>react-redux-18n provides a simple set of actions and reducer to store the current active locale and a dictionary the contains a set of translation dictionaries.</p><p>New dictionaries are loaded into a store via a loadTranslations action</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/287640ddb342df31f581508cf8feada1/href">https://medium.com/media/287640ddb342df31f581508cf8feada1/href</a></iframe><p>We use simple <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import">ECMAScript modules</a> to store our translations as part of our primary application bundle due to their small size but YAML or JSON configuration files could just as easily be mounted as part of a transpiler’s build configuration. We chose to couple all static copy to the client application because much of the copy is directly related to component development but it would be easy to load additional localized dictionaries from remote sources as part of a separate localized bundle since the active bundle is stored in application state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hyU3Id4bz1mTAO7wrNnXZg.gif" /></figure><h3>Configurable on a per package basis</h3><p>The Checkr/apply application derives the set of available languages from the API response for a given background check package. Right now we support English and Spanish for all of our background check applications domestically. We can easily configure international background checks to support a different set of default languages.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a807a5c0e39dd5e2f85320172e098740/href">https://medium.com/media/a807a5c0e39dd5e2f85320172e098740/href</a></iframe><h4>Dispatching a change or locale</h4><p>Updating a locale change requires an asynchronous request via <a href="https://github.com/gaearon/redux-thunk">redux-thunk</a> + a request to our API via <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API">fetch</a> in order to get translations for custom text snippets stored from our DB. We then dispatch the static locale change (that will trigger component updates) synchronously with our other custom text field state changes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/412eca903e44f6567b63b5a3fb10333f/href">https://medium.com/media/412eca903e44f6567b63b5a3fb10333f/href</a></iframe><h4>Connecting to the UI</h4><p>Connecting this action to the UI is simple. Here’s a simplified version of our LanguageDropdown component.</p><p>The component consists of:</p><ul><li>A dumb component LanguageDropdown that renders props that will be derived from mapStateToProps</li><li>A <a href="https://facebook.github.io/react/docs/higher-order-components.html">Higher Order Component</a> generated by connect that connects to the redux store and wraps our updateLocale action in our store’s dispatch.</li></ul><p>The component connects to our store to derive its localization state and available dropdown options:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3e1ba6e5c0d002601b207a01aedb928/href">https://medium.com/media/c3e1ba6e5c0d002601b207a01aedb928/href</a></iframe><p>Since our UI components are connected to the localization dictionary, any update made by the i18n reducer will trigger components to re-render based on the change in the translation key.</p><h3>Verifying integrity of localized dictionaries</h3><p>Given the legal sensitivity of our copy, it’s imperative that we validate for consistency across our dictionaries prior to deployment. We treat our English dictionary as the canonical set of keys and run a quick validation that all key paths exist in other localization dictionaries as part of our test suite.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d4fbd4ac5b1eac032279dbe3cab3f28/href">https://medium.com/media/0d4fbd4ac5b1eac032279dbe3cab3f28/href</a></iframe><p>Decoupling our localized copy from the components has had the added benefit of making translation and legal review a simple exercise that can be performed via a Github pull request by our Product Manager.</p><h3>Next steps</h3><p>Overall, we’re really happy with the flexibility that our React i18n implementation gives us. In fact, we’ve already ported the same pattern to another client-side service in our suite of services and we now implement localization in English and Spanish as a default.</p><p>In the future we’d like to do our best to anticipate the best language match for the applicant using the Accept-Language header to pre-select the preferred language rather than defaulting to English. Accept-Language provides the application with a set of probabilities that can be used to infer the preferred locale for the requesting user.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/23390ed1fc682bafb7a9103baf95c0fc/href">https://medium.com/media/23390ed1fc682bafb7a9103baf95c0fc/href</a></iframe><h3>Conclusion</h3><p>Integrating i18n into our React stack has greatly improved the workflow required to add additional localization to our client side applications. By smoothing out the process for legal review and translation, we’ve drastically reduced the cost of additional language support which will enable a better and fairer experience for applicants using our background check services.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7650878af6ef" width="1" height="1" alt=""><hr><p><a href="https://medium.com/checkr/using-dynamic-localization-to-improve-accessibility-with-react-and-redux-7650878af6ef">Using dynamic localization to improve Accessibility with React and Redux</a> was originally published in <a href="https://medium.com/checkr">Checkr Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>