Language settings are one of the few places static actually makes sense. Assuming your game is to be played in a single language once the setting is chosen. If you have multiple different characters speaking different languages you need to use GetComponent.
Here is working code using static
using UnityEngine;
using System.Collections;
public class englishorpolish : MonoBehaviour {
void OnGUI () {
if (GUI.Button (new Rect ((Screen.width+50)/2, (Screen.height)/2,100,50), "Polski", GUI.skin.GetStyle ("button"))) {
Head.language = 1;
}
if (GUI.Button (new Rect ((Screen.width-200)/2,(Screen.height)/2,100,50), "English", GUI.skin.GetStyle ("button"))) {
Head.language = 2;
}
}
}
public class Head {
public static int language;
}
Note: I strongly suspect your problem had nothing to do with accessing the variable, and everything to do with assigning it via +=. Your original code would increase the language by one. As ints default to zero I suspect both buttons were working but doing the dame thing.
Note: By convention class, struct and method names should start with a capital letter. Field, variable and property names start with a small letter. This will make it easier for others to read and assist.