Can I "translate" static URL's? I'm wondering if there's some build in function in Craft that can "translate" a URL the same as a string?

For example when I want to translate a static string I'll use the "t" Twig filer like so:

{{ "String"|t }}


Let's say I want to do the same, but with my localized URL's. Imaging this:

{{ url('a-url-slug')|t }}


Then in my translation file I can add different URL's that's localized (but loading the same template, I'm solving this using Routes).
Not sure if this is a good idea, but it does work. You simply got the syntax wrong, it should be:

{{ url('a-url-slug'|t) }}