the official
homepage of yasukuni shrine says:
"
When the Emperor Meiji visited Tokyo Shokonsha for the first time on January 27 in 1874, he composed a poem; "I assure those of you who fought and died for your country that your names will live forever at this shrine in Musashino". As can be seen in this poem, Yasukuni Shrine was established to commemorate and honor the achievement of those who dedicated their precious life for their country. The name "Yasukuni," given by the Emperor Meiji represents wishes for preserving peace for the nation.
Currently, more than 2,466,000 divinities are enshrined here at Yasukuni Shrine. These are souls of men who made ultimate sacrifice for their nation since 1853 during national crises such as the Boshin War, the Seinan War, the Sino-Japanese and Russo-Japanese wars, World War I, the Manchurian Incident, the China Incident and the Greater East Asian War (World War II). These people, regardless of their rank or social standing, are considered to be completely equal and worshipped as venerable divinities of Yasukuni."
at least i interpret this as it is only for those who died in wars for japan.