I am creating a set of graphs in two languages from ggplot2(Hadley Wikham). I could create them in two separate workflows by renaming the variables inside the original dataset. Instead, I want to change the object ggplot: I want to first create graphics in English, and then translate the labels into French. How to change / change legend keys inside ggplot object? And how can I sort the legend keys?
The reason I am exploring this approach is because I would like my story colors and characters to be the same in English and French, while at the same time having keyed legends in alphabetical order. The problem is that the keys of the French and English legends do not have the same alphabetical order (Spain versus Espagne). Compare the legend keys obtained using MWE : the legend keys are sorted alphabetically in the English legend, but incorrectly in the French legend.

Substitution xlab, ylab, ggtitleand styles change axes labels (for example, the formatting of numbers) is quite simple, so my focus is really on the legend keys and their order listed in the legend.
A MWE , ( group, colour shape ..):
df <- structure(list(year = c("2006", "2007", "2006", "2007", "2006",
"2007", "2006", "2007", "2006", "2007", "2006", "2007", "2006",
"2007", "2006", "2007", "2006", "2007", "2006", "2007", "2006",
"2007", "2006", "2007", "2006", "2007", "2006", "2007", "2006",
"2007", "2006", "2007", "2006", "2007", "2006", "2007", "2006",
"2007", "2006", "2007"), country = c("Australia", "Australia",
"Austria", "Austria", "Belgium", "Belgium", "Canada", "Canada",
"Denmark", "Denmark", "Finland", "Finland", "France", "France",
"Germany", "Germany", "Greece", "Greece", "Italy", "Italy", "Japan",
"Japan", "Netherlands", "Netherlands", "New Zealand", "New Zealand",
"Norway", "Norway", "Portugal", "Portugal", "Spain", "Spain",
"Sweden", "Sweden", "Switzerland", "Switzerland", "United Kingdom",
"United Kingdom", "United States", "United States"), value = c(33,
33, 33, 33, 30, 30, 34, 34, 30, 30, 33, 33, 28, 29, 27, 27, 40,
39, 35, 35, 35, 35, 27, 27, 33, 33, 27, 27, 37, 37, 32, 32, 31,
31, 32, 31, 32, 32, 33, 33)), .Names = c("year", "country", "value"
), row.names = c(NA, -40L), class = "data.frame")
library("ggplot2")
ggplot(data = df, aes(x = year, y = value, group = country, colour = country)) +
geom_line(size = 0.5) + geom_point(size = 1)
ggsave(last_plot(), file = "stackoverflow-1.png")
ggplot(data = df, aes(x = year, y = value, group = factor(country, labels = c("Australie", "Autriche", "Belgique", "Canada", "Danemark", "Finlande", "France", "Allemagne", "Grèce", "Italie", "Japon", "Pays-Bas", "Nouvelle-Zélande", "Norvège", "Portugal", "Espagne", "Suède", "Suisse", "Royaume-Uni", "États-Unis")), colour = factor(country, labels = c("Australie", "Autriche", "Belgique", "Canada", "Danemark", "Finlande", "France", "Allemagne", "Grèce", "Italie", "Japon", "Pays-Bas", "Nouvelle-Zélande", "Norvège", "Portugal", "Espagne", "Suède", "Suisse", "Royaume-Uni", "États-Unis")))) + geom_line(size = 0.5) + geom_point(size = 1) + theme(legend.title = element_blank())
ggsave(last_plot(), file = "stackoverflow-2.png")
, , ( ). :
list("A Cuckoo Land" = "Un Pays Idyllique", # This mapping is not used
"Australia" = "Australie",
"Austria" = "Autriche",
"Belgium" = "Belgique",
"Canada" = "Canada",
"Denmark" = "Danemark",
"Finland" = "Finlande",
"France" = "France",
"Germany" = "Allemagne",
"Greece" = "Grèce",
"Italy" = "Italie",
"Japan" = "Japon",
"Netherlands" = "Pays-Bas",
"New Zealand" = "Nouvelle-Zélande",
"Norway" = "Norvège",
"Portugal" = "Portugal",
"Spain" = "Espagne",
"Sweden" = "Suède",
"Switzerland" = "Suisse",
"United Kingdom" = "Royaume-Uni",
"United States" = "États-Unis")
. ( , , , , "Belgium" = c("Belgique", "Bélgica").