コード例 #1
0
        private void WriteTranslationBatch(ITranslationBatch batch)
        {
            Insert insert = GetTranslationBatchInsert(batch);

            ExecuteQuery(insert);
            OnWriteTranslationBatchEnd();
        }
コード例 #2
0
        private Insert GetTranslationBatchInsert(ITranslationBatch batch)
        {
            Insert translationBatchInsert =
                new Insert(UserConnection)
                .Into(TranslationSchemaName);

            translationBatchInsert.Set(TranslationKeyColumnName, Column.Parameter(batch.Key));
            batch.ForEach(translation => {
                translationBatchInsert.Set(translation.Key, Column.Parameter(translation.Value));
            });
            return(translationBatchInsert);
        }
コード例 #3
0
        /// <summary>
        /// Writes translation.
        /// </summary>
        /// <param name="key">Resource key.</param>
        /// <param name="translationColumnName">Translation column name.</param>
        /// <param name="translationColumnValue">Translation column value.</param>
        public override void WriteTranslation(string key, string translationColumnName,
                                              string translationColumnValue)
        {
            ITranslationBatch batch = ForceGetTranslationBatch(key);

            if (batch.ContainsKey(translationColumnName))
            {
                return;
            }
            batch.Add(translationColumnName, translationColumnValue);
            OnWriteTranslationEnd();
        }