How can I localize cpEditUrl? I use the following code to link to the CP from the front end:

{% if entry.isEditable() %}
  &lt;a href="{{ entry.cpEditUrl }}"&gt;Edit entry&lt;/a&gt;
{% endif %}


What do I have to add to link to the correct locale as it always jumps to the global locale instead of the current one?
The following code should work for you:

 {% if entry.isEditable() %}
    &lt;a href="{{ entry.cpEditUrl }}/{{ craft.locale }}"&gt;Edit entry&lt;/a&gt;
 {% endif %}