What accurately will set asset paths for multilingual sites?
If each locale uses the same TLD but uses a subfolder for localized content (i.e. example.com/en, example.com/de, etc.). You can move between development, staging, and production environments without having to change settings in the admin panel by simply using an absolute path in the Admin assets source URL setting (i.e. /assets/img/uploads) and a relative path for the File System Path there (i.e. ../public_html/assets/img/uploads).

For more complicated setups, such as independent site URLs (i.e. example.com, example.co.uk, etc) for each locale, I've set asset paths by setting an assetsUrl environment variable in general.php like so:

'example.com' =&gt; array(
    'environmentVariables' =&gt; array(
        'siteUrl'        =&gt; '//example.co.uk/',
        'assetsUrl'    =&gt; '//example.com/'
    )
)


Then in the Admin panel's assets source settings, I set a relative path for the File System Path and use the {assetsUrl} environment variable for the URL.



With this setup you can also move between development, staging, and production environments without having to change settings in the admin panel.

Once {assetsUrl} is set in the Admin panel for the URL, writing {{ file.url }} in your template will return the full URL using the assets source URL setting.

Or, you can link to assets (e.g. scripts) in your templates using the assetsUrl environment variable.

{{ craft.config.environmentVariables['assetsUrl'] }}assets/js/main.js