def setstr(self, key, string=None):
        """
            Add a translatable string to this widget

            @param key: the key for the string
            @param string: the string, or None to remove the key
        """

        ref = "%s:%s" % (self.ref, key)

        strings = self._strings
        if string:
            if hasattr(string, "flatten"):
                string = string.flatten()
            strings[ref] = string
        elif key in strings:
            del strings[ref]
        return

    # -------------------------------------------------------------------------
dataset/ETHPy150Open sahana/eden/modules/s3/s3xforms.py/S3XFormsWidget.setstr/original