Child of Text class not showing added public variable in insepctor

I’m currently working on a custom text class, but when i add a public variable, it does not show in the
inspector. for example:

public class TextTranslate : Text
{
    public string lineid;
}

When i add this to a canvas game object it behaves exactly like a text box but does not have the new variable. I have also tried making the variable serialized but no change.

search for the answer by oOHicksyOo

You need to create an Editor Script.

[CustomEditor(typeof(TextTranslate))]
public class MyTextTranslateEditor : Editor
{
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        TextTranslate i = (TextTranslate)target;
    }
}

Put that script in Assets/Editor folder and it should work fine, everything will appear