Hello, Edwin, I will answer you in english, as my knowledge of chinese is still limited. The gender of substantives in french for things that don't have a biological gender is, so to say, arbitrary (there are etymological/historical/cultural reasons, but it doesn't help for the learning of the language, at least at a basic-medium stage). So, whenever you learn a new substantive in french, you must also learn, at the same time, it's gender: LA lune, LE soleil, UNE étoile, LE ciel, LA terre...
Hope it helps!希望能帮到你