Problem to create background in language other than English in the settings
Default nodes are in same order

Since you are looking at the default nodes created when setting a world to use nodes, then the zeroth item is the output node, and the first the background node.

Simply reference them on creation, rather than using a key. 

&gt;&gt;&gt; nw = bpy.data.worlds.new("xxxx")
&gt;&gt;&gt; nw.use_nodes = True
&gt;&gt;&gt; nw.node_tree.nodes[:]
[bpy.data...nodes["World Output"], bpy.data...nodes["Background"]]

&gt;&gt;&gt; output, bg = nw.node_tree.nodes
&gt;&gt;&gt; output
bpy.data...nodes["World Output"]

&gt;&gt;&gt; bg
bpy.data...nodes["Background"]


To translate

To find what blender translates from the english to the currently set locale,



&gt;&gt;&gt; bpy.app.translations.locale
'es'

&gt;&gt;&gt; nw.node_tree.nodes[:]
[bpy.data...nodes["Entorno"], bpy.data...nodes["Fondo"]]

&gt;&gt;&gt; bpy.app.translations.pgettext("World Output")
'Entorno'

&gt;&gt;&gt; bpy.app.translations.pgettext("Background")
'Fondo'