Question: What would be the proper way to rewrite/translate Magento 2 checkout and user account URL's to make them localized for my language?

**1. Checkout**

Current checkout URL's are:

`domain.com/checkout`

`domain.com/checkout/#shipping`

`domain.com/checkout/#payment`

**2. User account**

Current user account url's are:

`domain.com/customer`

`domain.com/checkout/account/login`

`domain.com/checkout/account/edit`

`other similar user account URL's...`

Answer: 
You can do this by redefining the route. Create a new module that has a module.xml like so...

```
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="[Vendor]_[ModuleName]" setup_version="1.0.0">
        <sequence>
            <module name="Magento_Checkout"/>
        </sequence>
    </module>
</config>

```

Then in your etc/frontend/routes.xml...

```
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="checkout" frontName="custom-checkout-url">
            <module name="Magento_Checkout" />
        </route>
    </router>
</config>

```

I have not looked in to other ways to do it so not sure if it is the *best* way but i have tested it and it worked just fine.

**EDIT**

Because the route has now changed you need to fix up the section reloading when doing ajax. You do this with a "sections.xml" located in etc/frontend that will look something like...

```
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
    <action name="custom-checkout-url/cart/add">
        <section name="cart"/>
    </action>
</config>

```

Take a look in the Magento/Catalog/etc/frontend/sections.xml for all the actions you will need to override.
The easiest way is to use Magento's URL rewrite feature from your store admin section.

Here are the steps to do so for the domain.com/checkout url:

1. In the admin menu go to Marketing -> URL Rewrites.
2. Click the Add URL rewrite button.
3. Select the "Custom" URL rewrite type
4. Select the store/language for which you want to create the custom url (which will replace domain.com/checkout etc.)
5. In the requested path field enter your new custom url, e.g. new-checkout-url (without leading slahes)
6. In the target path field enter the current/default checkout url: checkout
7. Clear the cache and you're done (maybe also wait for cron to reindex the urls)

The same can be done for any other in-built Magento urls (like domain.com/contact or domain.com/cart).

This is a multi-store and multi-language friendly solution and is better and easier than the accepted answer in my opinion.